Python package not available from current channel

Viewed 6186

When I want to install jupyter notebook or spyder in one of my environments I encountered this error:

PackagesNotFoundError: The following packages are not available from current channels:

- python=3.1

Current channels:

- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
- https://conda.anaconda.org/conda-forge/win-64
- https://conda.anaconda.org/conda-forge/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.

Why would this happen?

Edit: I created the environment with scikit-learn, pytorch, and torchvision without specifying any version. After creating the environment, I tried installing spyder using both commands:

conda install spyder
conda install -c anaconda spyder

Neither worked. It seems that the environment automatically used python=3.1 when I created it.

Edit: When I put everything in one env.yml file instead of the command line it seems to work. Not sure why.

2 Answers

I've ran into the similar issue with my configuration:

$ conda -V
conda 4.10.3
$ python -V
Python 3.10.0

I see there is an issue that conda truncated Python version to one digit of the minor version (this would work for last 13 years since python 3.0 was released :-)) and there is a merged pull request fixing this issue: https://github.com/conda/conda/pull/10970/commits in conda 4.11

So, we just need to get that version of conda :)

It is not yet available at https://docs.conda.io/en/latest/miniconda.html, but has been available in the repo: https://github.com/conda/conda/releases/tag/4.11.0 since two weeks.

You are specifying python 3.1, which is long dead and therefore not available from any channels. You probably wanted to have the latest, which is 3.10, so you would need to specify it like that:

conda install -c conda-forge python=3.10

Note though that installing python 3.10 will not enable you (at the time of writing) to install jupyter and spyder. On my windows machine, qt dependencies cannot be matched. Possibly because no python 3.10 packages are available yet. I would suggest to just create the env specifying jupyter and spyder and have conda decide the latest available version:

conda create -n newEnv -c conda-forge jupyter spyder

Currently, that would be python 3.9.7

Related