简体   繁体   中英

Installing Python Package from Github Using PIP

I've seen it documented that you can install a Github hosting Python package using pip via:

sudo pip install -e git+git://github.com/myuser/myproject.git#egg=myproject

However, this appears to install the package to the current working directory, which is almost never where is should be.

How do you instruct pip to install it into the standard Python package directory (eg on Ubuntu this is /usr/local/lib/python2.6/dist-packages)?

The -e flag tells pip to install it as "editable", ie keep the source around. Drop the -e flag and it should do about what you expect.

sudo pip install git+git://github.com/myuser/myproject.git#egg=myproject

If that doesn't work try using https instead of git.

sudo pip install git+https://github.com/myuser/myproject.git#egg=myproject

For Python 3 make sure you have python3-pip installed (and of course git installed):

The syntax just changed to:

sudo pip3 install git+git://github.com/someuser/someproject.git

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM