I created a new virtual environment using the python virtualenv
tool.
virtualenv venv
I then activated the virtual environment
source venv/bin/activate
Then I did a pip freeze
and this is what I got:
(venv)$ pip freeze
Flask==0.10.1
Werkzeug==0.9.6
itsdangerous==0.24
lxml==3.4.0
numpy==1.9.1
pdir==0.2.2
virtualenv==1.11.6
wsgiref==0.1.2
I am wondering how so many libraries got installed when I did not even install anything in the virtual environment explicitly.
UPDATE 1: When some of the answers suggested, I used virtualenv --no-site-packages
as well in Step 1, to create a fresh venv and the same problem persisted. As if using the argument had no effect at all.
UPDATE 2: I was able to solve the problem and have posted my experience below. As pointed in the comments; here is a related question; link, that helped me solve the problem.
I was able to solve the problem. In my ~/.bash_profile file; I had the following line which was creating a problem:
As Martin Lewis, pointed out in an answer to this related question,
--no-site-packages
will remove the standard site-packages directory from sys.path. But anything else that lives in the standard Python path will still remain.P.S: I am still not sure why virtualenv works this way. Why include the packages that are there on PYTHONPATH. But at least knowing this solves my problem.