pip: pulling updates from remote git repository

24,417

Solution 1

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

Solution 2

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
Share:
24,417
Amelio Vazquez-Reina
Author by

Amelio Vazquez-Reina

I'm passionate about people, technology and research. Some of my favorite quotes: "Far better an approximate answer to the right question than an exact answer to the wrong question" -- J. Tukey, 1962. "Your title makes you a manager, your people make you a leader" -- Donna Dubinsky, quoted in "Trillion Dollar Coach", 2019.

Updated on January 24, 2021

Comments

  • Amelio Vazquez-Reina
    Amelio Vazquez-Reina over 3 years

    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 ...
    
  • Amelio Vazquez-Reina
    Amelio Vazquez-Reina almost 11 years
    Thanks. I presume that I need to uninstall the package then first? The odd thing is that pip could in principle remember that I got this from the git repository in first place, right? Is there a design decision behind this?
  • Blender
    Blender almost 11 years
    @user815423426: Pip will just upgrade the package.
  • Blender
    Blender almost 11 years
    @user815423426: As for the auto-upgrade, I have no clue. From what I can tell, Pip just packages the module into an egg and installs it. I'm sure it's possible to have it store the download URL somewhere, but I don't personally know if that's just a missing feature or a conscious design choice.
  • johan93
    johan93 almost 11 years
    You don't need to uninstall the package, it will do it itself.
  • user25064
    user25064 almost 9 years
    you don't need the -U flag for upgrade?
  • Wtower
    Wtower over 8 years
    I would strongly recomment to uninstall before re-installing. It occured to me that a newly committed file did not come forward and lost time looking around.
  • Dschoni
    Dschoni over 5 years
    if you use anaconda, having the git packages in an environment file will allow you to update everything by simply updating the whole environment using the file. See this answer: stackoverflow.com/questions/19042389/…