pythonpython-3.xcondaconda-forge

Error during conda install -c conda-forge nb_conda_kernels


I am trying to install Jupyter notebooks in Apple macbook m3 and I was following the instructions here: https://towardsdatascience.com/how-to-set-up-anaconda-and-jupyter-notebook-the-right-way-de3b7623ea4a

When I run conda install -c conda-forge nb_conda_kernels I get this error:

Solving environment: | warning  libmamba Added empty dependency for problem type SOLVER_RULE_UPDATE
failed

LibMambaUnsatisfiableError: Encountered problems while solving:

- nothing provides \_python_rc needed by python-3.12.0rc3-rc3_h47c9636_1_cpython

Could not solve for environment specs
The following packages are incompatible
├─ nb_conda_kernels is installable with the potential options
│  ├─ nb_conda_kernels 2.3.1 would require
│  │  └─ python \>=3.10,\<3.11.0a0 \*\_cpython, which can be installed;
│  ├─ nb_conda_kernels 2.3.1 would require
│  │  └─ python \>=3.11,\<3.12.0a0 \*\_cpython, which can be installed;
│  ├─ nb_conda_kernels 2.3.1 would require
│  │  └─ python \>=3.8,\<3.9.0a0 , which can be installed;
│  ├─ nb_conda_kernels 2.3.1 would require
│  │  └─ python \>=3.8,\<3.9.0a0 \*\_cpython, which can be installed;
│  ├─ nb_conda_kernels 2.3.1 would require
│  │  └─ python \>=3.9,\<3.10.0a0 , which can be installed;
│  ├─ nb_conda_kernels 2.3.1 would require
│  │  └─ python \>=3.9,\<3.10.0a0 *\_cpython, which can be installed;
│  ├─ nb_conda_kernels 2.3.1 would require
│  │  └─ python \>=3.8,\<3.12  with the potential options
│  │     ├─ python \[3.10.0|3.10.1|...|3.10.9\], which can be installed;
│  │     ├─ python \[3.11.0|3.11.1|...|3.11.8\], which can be installed;
│  │     ├─ python \[3.8.10|3.8.12|...|3.8.8\], which can be installed;
│  │     ├─ python \[3.9.0|3.9.1|...|3.9.9\], which can be installed;
│  │     ├─ python 3.12.0rc3 would require
│  │     │  └─ \_python_rc, which does not exist (perhaps a missing channel);
│  │     ├─ python \[3.10.0|3.10.10|...|3.10.9\], which can be installed;
│  │     ├─ python \[3.11.0|3.11.2|...|3.11.8\], which can be installed;
│  │     ├─ python \[3.8.11|3.8.13|...|3.8.19\], which can be installed;
│  │     └─ python \[3.9.11|3.9.12|...|3.9.7\], `your text`
│  ├─ nb_conda_kernels 2.3.1 would require
│  │  └─ \__win, which is missing on the system;
│  ├─ nb_conda_kernels 2.3.1 would require
│  │  └─ python \>=3.8,\<3.11 , which can be installed;
│  ├─ nb_conda_kernels 2.3.1 would require
│  │  └─ python \>=3.10,\<3.11.0a0 , which can be installed;
│  └─ nb_conda_kernels 2.3.1 would require
│     └─ python \>=3.11,\<3.12.0a0 , which can be installed;
└─ pin-1 is not installable because it requires
└─ python 3.12.* , which conflicts with any installable versions previously reported.

Pins seem to be involved in the conflict. Currently pinned specs:

- python 3.12.\* (labeled as 'pin-1')

What does this error mean? How can I fix it?

I was expecting nb_conda_kernels to install without any error.


Solution

  • The error message is saying there is no version of nb_conda_kernels that is compatible with Python 3.12.

    Moreover, that TDS article is not ideal advice. Rather, better practice is to create a dedicated environment for Jupyter and always launch Jupyter from there. Note that the Python version in that environment is really not so important since it doesn't put any restriction on the versions in other kernels.

    Create dedicated environment

    ## let the solver determine python version
    conda create -n jupyter -c conda-forge jupyterlab nb_conda_kernels
    

    Any other environments with ipykernel installed (or the language-equivalent, e.g., r-irkernel for R) will automatically be visible in Jupyter as available kernels.