18

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 (e.g. on Ubuntu this is /usr/local/lib/python2.6/dist-packages)?

2 Answers 2

26

The -e flag tells pip to install it as "editable", i.e. 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
Sign up to request clarification or add additional context in comments.

6 Comments

This is one of the first things I tried. Unfortunately, it just gives me the error "IOError: [Errno 2] No such file or directory: /tmp/git+git:/github.com/myuser/myproject.git#egg=myproject"
Can you run pip --version and tell me what it says? Make sure that you check the version of pip that you'll actually be using (if you will be installing inside a virtualenv, then make sure to check the version included in the virtualenv).
pip 0.3.1 from /usr/lib/python2.6/dist-packages (python 2.6)
Can you "sudo pip install --upgrade pip" for me? I believe this was a pip bug, and has been fixed several versions ago. For the record, I'm running pip 1.0.2 from /usr/local/lib/python2.7/site-packages (python 2.7)
Indeed, that was the problem. Upgrading pip fixed it. Thanks.
|
2

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.