I have a Django app and I’m getting an error whenever I try to run my code:
Error: No module named django_openid
Let me step back a bit and tell you how I came about this:
- I formatted my computer and completely re-installed everything — including virtualenv, and all dependent packages (in addition to Django) required for my project based on settings in my requirements.txt folder
- I tried doing
python manage.py syncdband got the error
I googled the issue, and many people say it could be a path problem.
I’m confused as to how I go about changing the path variables though, and what exactly they mean. I found some documentation, but being somewhat of a hack-ish noob, it kind of goes over my head.
So my questions are:
- What exactly is their purpose — and are they on a system based level based on the version of Python or are they project dependent?
- How can I see what mine are set to currently?
- How can I change them (ie. where is this .profile file they talk of and can I just use a text editor)
Any input you would have would be great as this one is stumping me and I just want to get back to writing code 🙂
Do you really need to alter the path? It’s always best to actually think about your reasons first. If you’re only going to be running a single application on the server or you just don’t care about polluting the system packages directory with potentially unnecessary packages, then put everything in the main system site-packages or dist-packages directory. Otherwise, use virtualenv.
The system-level package directory is always on the path. Virtualenv will add its site-packages directory to the path when activated, and Django will add the project directory to the path when activated. There shouldn’t be a need to add anything else to the path, and really it’s something you should never really have to worry about in practice.