pip: pulling updates from remote git repository

Question:

I installed scikit-learn from GitHub a couple of weeks ago:

pip install git+git://github.com/scikit-learn/scikit-learn@master

I went to GitHub and there have been several changes to the master branch since then.

How can I update my local installation of scikit-learn?

I tried pip install scikit-learn --upgrade but I got:

Requirement already up-to-date
Cleaning up ...

Answers:

pip searches for the library in the Python package index. Your version is newer than the newest one in there, so pip won’t update it.

You’ll have to reinstall from Git:

$ pip install git+git://github.com/scikit-learn/scikit-learn@main
Answered By: Blender

IIRC, Pip installs based on pypi. If you want to upgrade to the version that is currently hosted on github, then you are going to have to use the url from github.

Answered By: Games Brainiac

You need to install the version from github, or locally.

The way I usually do is that I git clone the repository locally and I run python setup.py install or python setup.py develop on it so I’m sure about the version being used.

Re-issuing the command you’ve done the first time with the upgrade flag would do the trick otherwise.:

pip install --upgrade git+git://github.com/scikit-learn/scikit-learn@main
Answered By: Alexis Métaireau

What worked for me was to use --force-reinstall:

pip install --force-reinstall --no-deps git+git://github.com/scikit-learn/scikit-learn@main

--no-deps to avoid reinstalling all the dependencies

Answered By: Michael Litvin
Categories: questions Tags: , , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.