conda update scikit-learn (also scipy and numpy)

前端 未结 2 583
北海茫月
北海茫月 2021-01-18 16:36

I think I have made a mess using pip install when I am supposed to use conda. As a result I couldn\'t update the scikit-learn package to the latest version. I uninstalled sc

2条回答
  •  清歌不尽
    2021-01-18 17:11

    It looks like the versions reported by conda do not match the versions you're importing when you run Python. This makes me think that you've installed these packages in multiple places, and have your $PYTHONPATH variable set so that Python is finding different installations (sometimes installing some toolkit will add this in your bash/sh startup script) Try running

    $ echo $PYTHONPATH
    

    If anything is shown here, find your startup script and comment that out. After making sure that $PYTHONPATH is empty, try the following:

    $ conda update conda  # make sure package listing is up-to-date
    $ conda remove numpy scipy scikit-learn
    $ conda install scikit-learn
    

    That has generally worked for me in the past.

提交回复
热议问题