rbanffy / pip-chill

A more relaxed `pip freeze`
Other
557 stars 25 forks source link

pip-chill picks up site-packages in virtualenv with --no-site-packages #19

Closed CounterPillow closed 5 years ago

CounterPillow commented 5 years ago

Description

pip-chill picks up site-packages even if the virtualenv it was installed and executed in specifies --no-site-packages.

What I Did

virtualenv --no-site-packages venv
source venv/bin/activate
pip install -r requirements.txt
pip install pip-chill
pip-chill  # this shows site-packages like youtube-dl etc.

EDIT: Looks like --no-site-packages is the default now, so pip-chill installed in a virtualenv should never pick up packages from outside the virtualenv.

CounterPillow commented 5 years ago

Nevermind, I found what went wrong.

Having a --user site install of pip-chill makes it pick up all site packages even if you install pip-chill in the virtualenv, probably because of $PATH weirdness. I checked the $PATH and the virtualenv pip should've been in there first, but apparently wasn't picked up until I uninstalled the site one, and only worked when I reactivated the venv in a new shell. Odd.