I am trying to create a virtualenv and install packages from requirements.txt that I have with the project.
When I create the environment, I check that the python and pip indeed come from that enviroment. Namely, when I run:
I get results that point to the binaries located inside the virtualenv directory
I then proceed to install the packages:
pip install -r requirements.txt
For awhile, it was giving me trouble about the
pkg-resources=0.0.0 line within the requirements.txt. As it turned, that line is input into this file because of a bug in Ubuntu. As you can probably surmise, I had created this file on an Ubuntu machine.
Once I strike the line out, the installation proceeds.
However, when I run pip list after the installation, the list contains only
pip (8.1.1) pkg-resources (0.0.0) setuptools (20.7.0)
What is more, if I deactivate the virtualenv and run pip list globally, I see that all of the dependencies were installed globally.
There are two questions here. One - that is most obious - why does it happen? The second one is how could I clean up my global packages and uninstall the pollutants which now reside there?
Yet another bizarre behavior consists of the following. When I try to run
sudo pip uninstall -r requirements.txt from within the virtualenv with hopes of reversing the global installation, I get the following error:
Cannot uninstall requirement aldryn-apphooks-config, not installed
That is, it appears that when I try to uninstall, pip tries to look for packages inside the virtualenv.
On the other hand, when I deactivate the virtualenv, I can successfully uninstall the packages from the global installation using the same command.
Somehow, there is a difference in how the pip install command works on Ubuntu when compared to the pip uninstall command. They "look" for packages in different places.