1

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

user64150
  • 59
  • 5

1 Answers1

0

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. E.g., 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 - i.e., 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.

merv
  • 67,214
  • 13
  • 180
  • 245
  • Option 1 solved the problem. Many thanks (also for the work-flow suggestion)! I tried also 2, but that runs into the same issues as PyGMO installation. – user64150 May 11 '21 at 16:45
  • Okay, so likely there was a real conflict. Note that if you did install Mamba, you might as well keep on using it, e.g., you could do (1) as ` mamba create -n pygmo_env -c conda-forge pygmo`. – merv May 11 '21 at 20:39
  • Actually, I did not manage to install Mamba as Anaconda started reporting conflicts in the very same fashion as it was reporting conflicts for PyGMO. Would you have ideas how to tackle this? – user64150 May 12 '21 at 08:52
  • @user64150 Maybe ask a new question and report what the conflicts are. Personally, I would look into simply removing Anaconda as your **base** and replacing it with Miniforge or Mambaforge. Then try to avoid using the **base** environment as a working env; it should really just be for the Conda infrastructure. – merv May 13 '21 at 15:21