简体   繁体   English

conda-forge 安装旧版本时如何升级

[英]How to upgrade when conda-forge installs an old version

pandas-profiling (appears to be) a delightful little package that improves on the pd.DataFrame.describe() method. pandas-profiling (似乎是)一个令人愉快的小 package 改进了pd.DataFrame.describe()方法。 I decided to install it using conda , and, as per the documentation , I input conda install -c conda-forge pandas-profiling on the command line.我决定使用conda安装它,并且根据文档,我在命令行上输入conda install -c conda-forge pandas-profiling

Here's where it gets wonky.这就是它变得不稳定的地方。 The current build of pandas-profiling is 2.8.0. pandas-profiling的当前版本是 2.8.0。 This is the text that returned on the command line:这是在命令行上返回的文本:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pandas-profiling-1.4.1     |                0          39 KB  conda-forge
    ------------------------------------------------------------
                                           Total:          39 KB

The following NEW packages will be INSTALLED:

  pandas-profiling   conda-forge/osx-64::pandas-profiling-1.4.1-0

...Version 1.4.1? ...版本 1.4.1? That doesn't seem right.这似乎不对。 I'll likely be missing out on some significant functionality.我可能会错过一些重要的功能。 I'd like to upgrade, but, being the neophyte data scientist I am, I'm not familiar enough with conda as a package manager to either figure out why the latest build on conda-forge is 1.4.1 or how to upgrade, either via pip or conda (ideally via conda, for the sake of consistency).我想升级,但是,作为新手数据科学家,作为 package 经理,我对conda不够熟悉,无法弄清楚为什么 conda conda-forge forge 的最新版本是 1.4.1 或如何升级,通过pipconda (为了一致性起见,最好通过 conda)。

I then investigated the builds with conda search pandas-profiling --info , which revealed the following about the 1.4.1_0 build that appeared to install:然后,我使用conda search pandas-profiling --info调查了构建,它揭示了以下关于似乎安装的1.4.1_0构建的信息:

pandas-profiling 1.4.1 0
------------------------
file name   : pandas-profiling-1.4.1-0.tar.bz2
name        : pandas-profiling
version     : 1.4.1
build       : 0
build number: 0
size        : 39 KB
license     : MIT
subdir      : osx-64
url         : https://conda.anaconda.org/conda-forge/osx-64/pandas-profiling-1.4.1-0.tar.bz2
md5         : 9a23538636bc7bcc05c6e7a90bca3c33
constraints :
  - pypy <0a0
dependencies:
  - jinja2 >=2.8
  - matplotlib >=1.4
  - pandas >=0.19
  - python >=2.7
  - six >=1.9

This was built for Python 2.7, but my conda is managing for version 3.7.6!这是为 Python 2.7 构建的,但我的conda正在管理版本 3.7.6!

Does anyone have any insight into what's going on here and how I can upgrade to the latest build?有没有人知道这里发生了什么以及如何升级到最新版本?

How I solved this was by making sure conda was updated before trying to install pandas-profiling.我如何解决这个问题是在尝试安装 pandas-profiling 之前确保 conda 已更新。 And it was in a new environment.而且是在一个新的环境中。

Create a new environment:创建一个新环境:

conda create -n new_env

Install conda in it (it should be the latest version by default, but verify and update it if necessary):在其中安装 conda(默认情况下应该是最新版本,但如果需要,请验证并更新它):

conda activate new_env

conda install conda

Install pandas-profiling:安装熊猫分析:

conda install -c conda-forge pandas-profiling

An up-to-date conda was the key.最新的 conda 是关键。 Also, when pandas-profiling (outdated version) was already installed in the environment, uninstalling and reinstalling didn't work.此外,当环境中已经安装了 pandas-profiling(过时版本)时,卸载和重新安装不起作用。

In cases like this, it's likely that there is some incompatibility between the dependencies of your current environment and the dependencies of the new package ( pandas-profiling ), at least according to the most recent version of the package.在这种情况下,至少根据 package 的最新版本,您当前环境的依赖项与新 package ( pandas-profiling ) 的依赖项之间可能存在一些不兼容。

But apparently conda was able to find an older version of the package that has looser requirements (possibly due to a bug in that old package's metadata), so it decided to give you that version instead.但显然 conda 能够找到 package 的旧版本,它的要求更宽松(可能是由于旧包的元数据中的错误),所以它决定给你那个版本。

To specify the exact version you're looking for, try one of the following:要指定您要查找的确切版本,请尝试以下操作之一:

conda install -c conda-forge pandas-profiling=2.8
conda install -c conda-forge pandas-profiling=2.8.0

If that fails, try this, just to see what it brings along with it:如果失败了,试试这个,看看它带来了什么:

conda create -n testenv -c conda-forge pandas-profiling=2.8.0 python=3.7

Try installing its dependencies one at a time into your preferred environment (specifying versions) and see which one fails to install.尝试一次将其依赖项安装到您的首选环境中(指定版本),然后查看哪个安装失败。 That may give a clue about where the incompatibility comes from.这可能会提供有关不兼容性来自何处的线索。

Using conda search --info (as you did) is also a good way to to figure out what's going on with the dependencies.使用conda search --info (正如你所做的那样)也是找出依赖项发生了什么的好方法。 But if you discover any problems with the package, or you need other details w.r.t.但是,如果您发现 package 有任何问题,或者您需要其他详细信息 w.r.t。 how it was built, the recipe for conda-forge's python-profiling package can be found here .它是如何构建的,conda python-profiling package 的配方可以在里找到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM