Sometimes I get errors that I suspect are the result of my Django app using globally installed Python modules/Django apps instead of those within its virtualenv.
Is there a way to check whether my app’s virtualenv was created with ‘–no-site-packages’ without having to delete it, then re-create it as follows?
deactivate
rmvirtualenv my_env
mkvirtualenv my_env --no-site-packages
workon my_env
pip install -r requirements.txt
Surely there must be a better way! Thanks.
There’s a file in
<env>/lib/pythonX.X/calledno-global-site-packages.txtwhen you create a virtual environment with--no-site-packages.Just tried this with virtualenv 1.7: