Conda reports PackagesNotFoundError: python=3.1 for reticulate environment

Conda 4.10 is incompatible with python 3.10.

The issue is not related to R, and maybe there is nothing wrong with your code. The same type of problem occurred at the following SO issues:

Solutions

If you need python 3.10+

If you need python 3.10 or newer, you must have conda 4.11 or newer. Install the desired conda version, or switch to the base environment and update conda using conda update conda. Something like:

conda activate base
conda update conda
conda create --name r-reticulate python=3.10 pandas numpy scipy matplotlib scikit-learn
conda activate r-reticulate

You may need to add non-default channels to your conda, as I get an UnsatisfiableError using it. By using the conda-forge channel e.g., I got no error (but this may install newer than usual packages):

conda create --name r-reticulate -c conda-forge python=3.10 pandas numpy scipy matplotlib scikit-learn

If you want to keep the old conda

Install another environment from base with python 3.9 or older like

conda activate base
conda create --name r-reticulate python=3.9 pandas numpy scipy matplotlib sklearn
conda activate r-reticulate

Other symptoms

You basically cannot install anything after creating and activating your python 3.10 environment. You cannot even install conda-build:

conda install conda-build -y
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.

ResolvePackageNotFound:
  - python=3.1

Conda 4.10 contains python 3.9 and conda 4.11 contains python 3.10, so your base environment should be compatible with the python version therein.

duplicate?

If you believe that your question is a duplicate, please check how you can improve it.

This answer is in agreement with meta. I believe this is an example where exactly the same answer should be accepted, but I also customized the answer to the question.

Leave a Comment