Cannot update python package on anaconda to latest version

社会主义新天地 提交于 2021-01-27 07:06:07

问题


Some of my python packages on anaconda cannot be updated to the latest version.

For instance, beautifulsoup4 latest version on anaconda is v4.71 as seen in the release notes. https://docs.anaconda.com/anaconda/reference/release-notes/

However, when I run conda update beautifulsoup4, the latest version that I can update to is v4.6.

I discovered that the channel used by beautifulsoup4 is pypi.

# Name                    Version                   Build  Channel
beautifulsoup4            4.6.0                    pypi_0    pypi 
bleach                    3.1.0                      py_0    conda-forge

I suspect if I were to change the channel from pypi to conda-forge, I should be able to update to the latest version.

How can I change the channel from pypi to conda-forge? Or does the solution lies somewhere else?

I am using Windows 10 64-bit, python 3.7.


回答1:


I was running through this problem myself.

Let's take a look at versions in conda-forge and PyPi:

  • Conda Forge
  • PyPi

Both are actually up to date. So the problem here isn't as much the channels but conda mixing up the reference for the labels.

Update conda with

conda update

This will actually spew out a message telling you to run the command with a prefix for the proper path for your environment. Should be something like this:

conda update --prefix C:\Users\yourAccount\AppData\Local\Continuum\anaconda3 anaconda

Run that and it will update packages as well, including beautifulsoup4.

After this, you'll notice that creating new environment with just conda install beautifulsoup4 will return you the latest version.


Another curious thing to notice is that

There aren't distributions of 4.7 for Win-32 or Linux-32. So, if you are on either of those, updating conda won't help. You'll have to get the source code and build it yourself (if it is even possible).



来源:https://stackoverflow.com/questions/55848202/cannot-update-python-package-on-anaconda-to-latest-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!