How do I change the default directory that pip installs to?

前端 未结 2 1410
野的像风
野的像风 2021-01-05 12:06

When I run the commmand

pip install virtualenv

I get:

Installing virtualenv script to /usr/local/share/python
2条回答
  •  北荒
    北荒 (楼主)
    2021-01-05 12:30

    If you want to manually decide where you want packages to reside, you could always download the source distribution to a directory of your choice with the following:

    pip install -d 
    

    But when you install, I think you probably want to put the executable console scripts (as defined in the package's setup.py file; like virtualenv for example) in a directory included in your $PATH environmental variable.

    You can specify this manually by doing the following:

    sudo python setup.py install --install-scripts /usr/bin/
    

    orsudo python setup.py install --install-scripts /usr/local/bin/

    Let me know if you have any other questions...

提交回复
热议问题