System PIP instead of virtualenv PIP by default?

后端 未结 2 1212
慢半拍i
慢半拍i 2021-01-13 08:08

After using virtualenv with pip off-and-on for a couple of days, I\'ve found that the version of PIP that is used after the virtualenv is actived is the global PIP instead o

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-13 09:07

    It is not the first time I see someone reporting the same issue. I don't know what is happening, but some people discourage the use o source /path/to/venv/bin/activate because it can mess up your $PATH.

    There is a way pip will always respect your virtualenv: don't rely on $PATH. Use:

    /path/to/venv/bin/pip install MYPACKAGE
    

    It would be nice to find out what is happening to you and share your solution with others. Meanwhile, it may be ok to use the absolute path to pip.

提交回复
热议问题