简体   繁体   中英

Conflicts during PyGMO installation on Mac OS X 11.2.2 with Anaconda

I am attempting to install PyGMO on Mac OS X 11.2.2 (with Anaconda which I reinstalled so the Anaconda Navigator is now upgraded to 2.0.1.)

After the installation starts, it collects package metadata and reports it found package conflicts. How can I solve the conflict so that I can run PyGMO?

Here is the start:

$ conda install -c conda-forge pygmo
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \ 
Found conflicts! Looking for incompatible packages.

After few hours, the Terminal returns a long report of conflicts and stops there. Here is a representative piece of output:

Package selectors2 conflicts for:
wurlitzer -> selectors2
spyder-kernels -> wurlitzer[version='>=1.0.3'] -> selectors2

Package mpmath conflicts for:
anaconda==2020.07=py38_0 -> sympy==1.6.1=py38_0 -> mpmath[version='>=0.19']
sympy -> mpmath[version='>=0.19']
anaconda==2020.07=py38_0 -> mpmath==1.1.0=py38_0

Package anyio conflicts for:
jupyterlab -> jupyter_server[version='>=1.4,<2'] -> anyio[version='>=2.0.2|>=2.0.2,<3']
jupyterlab_server -> jupyter_server[version='>=1.4,<2'] -> anyio[version='>=2.0.2|>=2.0.2,<3']

Package py-lief conflicts for:
conda-build -> py-lief
anaconda==2020.07=py38_0 -> py-lief==0.10.1=py38haf313ee_0
Note that strict channel priority may have removed packages required for satisfiability.

I followed the official installation guidelines and set the additional channel and its priority. I also checked this command but that is essentially the same thing. I also tried the installation commands from PyPI . And I tried this hint as well

There are two possible states:

  1. Conda solver is correct. The previous package constraints you have in the environment are incompatible with installing pygmo . In that case, you either need to track down the conflicting constraints and try to manually loosen them (not recommended for Anaconda base ), or you need to make a new environment:

     conda create -n pygmo_env -c conda-forge pygmo

    Include whatever other packages you need in there. Eg, ipykernel if you plan on using it as a Jupyter kernel.

  2. Conda solver is bugging out. The solver is reporting trouble solving when it really shouldn't be. This happens, and especially happens when mixing channels ( defaults and conda-forge ). Many find Mamba , the drop-in replacement for Conda, to be more reliable (and definitely faster.).

     conda install conda-forge::mamba mamba install -c conda-forge pygmo

Unfortunately, it's hard to tell which state it's in. Many of us have been down the rabbit hole of trying to sort through the constraint reports and sometimes there really isn't a sensible conflict to be found. For practical purposes, I'd recommend trying out mamba . If it also fails, then at least you'll have good evidence that you're in state (1) .


Additional Commentary

Despite upbeat documentation about installing from any channel in Anaconda Cloud, an Anaconda distribution is highly constrained - ie, has too many packages - and only tests for co-installation of packages from the defaults channel. Additionally, Conda Forge and Anaconda have different build stacks, so there can be runtime package incompatibilities even when the solver allows co-installation.

Generally, I'd recommend making liberal use of environment creation. Aim to have separate environments for separate tasks/projects. If you plan on frequently using more than a vanilla Anaconda distribution, consider Miniforge or one of its variants. One can always create an Anaconda environment with conda create -n foo -c defaults anaconda .

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