[Django]-Including Git submodules on pythonpath when using virtualenv

3👍

dump all your installed packages in a requirement file (requirements.txt looks the standard naming) using

pip freeze > requirements.txt

everytime you need a fresh virtualenv you just have to do:

virtualenv <name> --no-site-packages
pip install -r requirements.txt

the install -r requirements.txt works great also if you want to update to newer packages

just keep requirements.txt in sync with your packages (by running pip freeze every time something changes) and you’re done, no matter how many virtualenv you have.

NOTE: if you need to do some development on a package you can install that using the -e (editable) param, this way you can edit the package and you don’t have to uninstall/install every time you want to test new stuff 🙂

Leave a comment