I can't seem to get my manage.py script to recognize the django module. pip install req/dev.txt installs all of the modules I would expect it to into my my python virtual environment (stored at .venv).
I think I've narrowed it down to a problem with either my $PYTHON_PATH or with my pip requirements files. I've looped through sys.path, and I see that one of the values points to a folder in .venv that I can confirm contains the django module.
I'm unfortunately at a loss. I've searched through a dozen related questions on Stack Overflow and have yet to find a solution that works. Does anyone have any clues to point me in the right direction?
Error message:
$ python manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/nathan/www/myapp/.venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/Users/nathan/www/myapp/.venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 312, in execute
django.setup()
File "/Users/nathan/www/myapp/.venv/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/nathan/www/myapp/.venv/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/Users/nathan/www/myapp/.venv/lib/python2.7/site-packages/django/apps/config.py", line 119, in create
import_module(entry)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named django
Contents of reqs/dev.txt
-r common.txt
django-debug-toolbar==1.3.2
Contents of reqs/common.txt
django==1.8
Fabric==1.10.2
ShopifyAPI>=2.1.5
Sphinx==1.3.1
celery>=3.1.20
django-compressor>=1.5
django-toolbelt>=0.0.1
jdcal>=1.0
kombu>=3.0.35
openpyxl==2.2.5
python-dateutil>=2.4.2
psycopg2>=2.5
requests==2.7.0
whitenoise==2.0
shippo==1.4.0
Contents of manage.py:
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myapp.settings.dev")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)