Where should virtualenvs be created?

Many people use the virtualenvwrapper tool, which keeps all virtualenvs in the same place (the ~/.virtualenvs directory) and allows shortcuts for creating and keeping them there. For example, you might do: mkvirtualenv djangoproject and then later: workon djangoproject It’s probably a bad idea to keep the virtualenv directory in the project itself, since you don’t … Read more

Where is virtualenvwrapper.sh after pip install?

You can use the find command to search for a file: find / -name virtualenvwrapper.sh This will search all directories from the root for the file. on ubuntu 12.04 LTS, installing through pip, it is installed to /usr/local/bin/virtualenvwrapper.sh on ubuntu 17.04, installing through pip as a normal user, it is installed to ~/.local/bin/virtualenvwrapper.sh

How to use MySQLdb with Python and Django in OSX 10.6?

I had the same error and pip install MySQL-python solved it for me. Alternate installs: If you don’t have pip, easy_install MySQL-python should work. If your python is managed by a packaging system, you might have to use that system (e.g. sudo apt-get install …) Below, Soli notes that if you receive the following error: … Read more

How do I remove/delete a virtualenv?

“The only way I can remove it seems to be: sudo rm -rf venv“ That’s it! There is no command for deleting your virtual environment. Simply deactivate it and rid your application of its artifacts by recursively removing it. Note that this is the same regardless of what kind of virtual environment you are using. … Read more

What is the difference between venv, pyvenv, pyenv, virtualenv, virtualenvwrapper, pipenv, etc?

This is my personal recommendation for beginners: start by learning virtualenv and pip, tools which work with both Python 2 and 3 and in a variety of situations, and pick up other tools once you start needing them. Now on to the answer to the question: what is the difference between these simalarly named things: … Read more

How to leave/exit/deactivate a Python virtualenv

Usually, activating a virtualenv gives you a shell function named: $ deactivate which puts things back to normal. I have just looked specifically again at the code for virtualenvwrapper, and, yes, it too supports deactivate as the way to escape from all virtualenvs. If you are trying to leave an Anaconda environment, the command depends … Read more