virtualenvwrapper (Part 1)
I use virtualenv but so far it’s been enough for me. However, the time has come to step on to the next level: virtualenvwrapper. Virtualenvwrapper is just a wrapper around virtualenv, but it makes working with virtualenv so much easier.
Problem
I keep all my Python projects in Dropbox. Every project is located in a dedicated folder. If I use virtualenv, inside a project folder I need to create a subfolder for the the virtual environment (typically called “venv”). However, this folder can be really huge. In the case of a Flask project it can be up to 50-60 MB. Keeping it in Dropbox is a luxury. It would be great to move the virtual environments outside of Dropbox. My first idea was to put a symbolic link on the venv folder from the project folder but Dropbox doesn’t support symlinks :(
Solution
Let’s use virtualenvwrapper! Virtualenvwrapper was created with this idea: collect virtual environments in a separated folder, outside of your projects. In addition, it’s very easy to switch between virtual environments.
Here are some great resources on virtualenvwrapper:
- Doug Hellman’s virtualenvwrapper notes (BTW, he is the creator of virtualenvwrapper)
- official docs
- Getting Started with virtualenv and virtualenvwrapper in Python (Bob’s blog)
For more info, refer to Bob’s blog (last link above), where he gives a very nice summary about the usage of virtualenvwrapper.
