0

I tried to install all dependencies in my requirements.txt (a bunch of packages list). What I did:

  • created virtual env virtualenv my_env
  • activated the new virtual env, I'm able to see my virtual env before the prompt (my_env) $
  • ran pip install -r requirements.txt

All packages got installed, but when checking with pip freeze I have nothing. Tried to deactivate the virtual env, and made pip freeze again, here I have all installed.

I'm a bit confused because, I'm very sure my virtual env was activated, and I have the right pip path when doing which pip inside it (/home/virtual_env/my_env/bin/pip). Plus, I tried to install one by one the dependency, and they got installed right inside the virtual env & displayable with pip freeze

I cannot do all of them one by one, and I need to reproduce the installation somewhere. Could someone helps on this?

4givN
  • 2,936
  • 2
  • 22
  • 51
  • Sometimes using `python -m pip command ...` instead of `pip command ...` helps. Make sure the `python` binary is also the right one with `which python`. – sinoroc Dec 10 '19 at 09:59
  • Did you use `sudo`? – phd Dec 10 '19 at 10:17
  • No I didn't use sudo. – 4givN Dec 10 '19 at 10:18
  • found another related tickets but none of provided solution worked :( : https://stackoverflow.com/questions/20952797/pip-installing-in-global-site-packages-instead-of-virtualenv, https://stackoverflow.com/questions/20942982/virtualenv-pip-trying-to-install-packages-globally – 4givN Dec 10 '19 at 12:53
  • Anything helpful in the verbose, or debug output? – sinoroc Dec 11 '19 at 13:49
  • Anything helpful in the verbose – 4givN Dec 17 '19 at 09:04

1 Answers1

0

Still no clean solution for this so far, but what would work is to copy-edit (search & replace the return character in the requirements.pip to && pip install. Meaning, edit it from this format

package1==vX.Y
package2==vU.V
...

into this

package1==vX.Y && pip install package2==vU.V ...

Add pip install at the beginning then make a copy to all for install command like

pip install package1==vX.Y && pip install package2==vU.V ...
4givN
  • 2,936
  • 2
  • 22
  • 51