I installed a virtualbox with xubuntu-16.04.2-desktop on windows 10. when I create an env running a mezzanine app, I get this error:
Traceback (most recent call last):
File "manage.py", line 7, in <module>
from mezzanine.utils.conf import real_project_name
ImportError: No module named 'mezzanine'
the same when I try to import modules:
(test) mauri@bison:~$ python -c "import django"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named 'django'
the problem seems to be the PYTHONPATh, not set correctly. If i set it manually, everything works fine.
(test) mauri@bison:~$ export
PYTHONPATH="/home/mauri/envs/test/lib/python3.5/site-packages/"
(test) mauri@bison:~$ python -c "import django"
(test) mauri@bison:~$ env
XDG_VTNR=7
LC_PAPER=cs_CZ.UTF-8
LC_ADDRESS=cs_CZ.UTF-8
XDG_SESSION_ID=c1
....
any idea why the PYTHONPATH is not set automatically when I create envs?
thank you so much, and sorry if I miss anything in the explaination, I m pretty new in this field.
PYTHONPATHenvironment doesn't get set when you activate a virtual environment. That isn't how it works. Runpythonand doimport sys; print(sys.path), thesite-packagesdirectory should be automatically added.(test) mauri@bison:~$ python -c "import sys; print(sys.path)" ['', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']