简体   繁体   中英

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. 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.

Here's where it gets wonky. The current build of pandas-profiling is 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? 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).

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:

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!

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. 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 activate new_env

conda install conda

Install pandas-profiling:

conda install -c conda-forge pandas-profiling

An up-to-date conda was the key. Also, when pandas-profiling (outdated version) was already installed in the environment, uninstalling and reinstalling didn't work.

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.

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.

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. But if you discover any problems with the package, or you need other details w.r.t. how it was built, the recipe for conda-forge's python-profiling package can be found here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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