Install a Python package into a different directory using pip?

后端 未结 16 2749
借酒劲吻你
借酒劲吻你 2020-11-22 05:55

I know the obvious answer is to use virtualenv and virtualenvwrapper, but for various reasons I can\'t/don\'t want to do that.

So how do I modify the command

16条回答
  •  情书的邮戳
    2020-11-22 06:12

    Use:

    pip install --install-option="--prefix=$PREFIX_PATH" package_name
    

    You might also want to use --ignore-installed to force all dependencies to be reinstalled using this new prefix. You can use --install-option to multiple times to add any of the options you can use with python setup.py install (--prefix is probably what you want, but there are a bunch more options you could use).

提交回复
热议问题