{"action":"created","issue":{"url":"https://api.github.com/repos/docker-library/celery/issues/7","labels_url":"https://api.github.com/repos/docker-library/celery/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/docker-library/celery/issues/7/comments","events_url":"https://api.github.com/repos/docker-library/celery/issues/7/events","html_url":"https://github.com/docker-library/celery/issues/7","id":109009773,"number":7,"title":"Keyerror when importing .pyc files","user":{"login":"derrend","id":3506822,"avatar_url":"https://avatars.githubusercontent.com/u/3506822?v=3","gravatar_id":"","url":"https://api.github.com/users/derrend","html_url":"https://github.com/derrend","followers_url":"https://api.github.com/users/derrend/followers","following_url":"https://api.github.com/users/derrend/following{/other_user}","gists_url":"https://api.github.com/users/derrend/gists{/gist_id}","starred_url":"https://api.github.com/users/derrend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derrend/subscriptions","organizations_url":"https://api.github.com/users/derrend/orgs","repos_url":"https://api.github.com/users/derrend/repos","events_url":"https://api.github.com/users/derrend/events{/privacy}","received_events_url":"https://api.github.com/users/derrend/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-30T03:57:29Z","updated_at":"2016-01-21T23:11:53Z","closed_at":null,"body":"I'm trying to only mount the essential files into the container from the outside like so:\r\n\r\n    -v /celeryconfig.py:/home/user/celeryconfig.py:ro \\\r\n    -v /cpop/cpop/settings.py:/home/user/cpop/settings.py:ro \\\r\n    -v /cpop/popsite/tasks.py:/home/user/popsite/tasks.py:ro\r\n\r\nwhich works fine.\r\nproblem is if i compile the .py files into .pyc and change the mount options like so:\r\n\r\n    -v /celeryconfig.pyc:/home/user/celeryconfig.pyc:ro \\\r\n    -v /cpop/cpop/settings.pyc:/home/user/cpop/settings.pyc:ro \\\r\n    -v /cpop/popsite/tasks.pyc:/home/user/popsite/tasks.pyc:ro\r\n\r\nit breaks.\r\nCan anyone suggest why this might be?"},"comment":{"url":"https://api.github.com/repos/docker-library/celery/issues/comments/173745534","html_url":"https://github.com/docker-library/celery/issues/7#issuecomment-173745534","issue_url":"https://api.github.com/repos/docker-library/celery/issues/7","id":173745534,"user":{"login":"derrend","id":3506822,"avatar_url":"https://avatars.githubusercontent.com/u/3506822?v=3","gravatar_id":"","url":"https://api.github.com/users/derrend","html_url":"https://github.com/derrend","followers_url":"https://api.github.com/users/derrend/followers","following_url":"https://api.github.com/users/derrend/following{/other_user}","gists_url":"https://api.github.com/users/derrend/gists{/gist_id}","starred_url":"https://api.github.com/users/derrend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derrend/subscriptions","organizations_url":"https://api.github.com/users/derrend/orgs","repos_url":"https://api.github.com/users/derrend/repos","events_url":"https://api.github.com/users/derrend/events{/privacy}","received_events_url":"https://api.github.com/users/derrend/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T23:11:53Z","updated_at":"2016-01-21T23:11:53Z","body":"I think I figured it out, sort of. The container is running python 3 which doesn't seem to compile .pyc files and put them in the same directory, instead it compiles them with a very different name (not .pyc) and places them in a subdirectory which broke my scripts because my django project and other network containers use python 2.7 so my `from <module> import <file>.pyc` lines were failing.\r\n\r\nI still ended up using the uncompiled source code. I will try and remember to post an update if I find a more effective fix.\r\n\r\nThanks for the help :)"}}