问题
I have miniconda 3 installation and want to create conda environment with Python 3.4. I used the command: conda create -n myenv python=3.4
and get the error:
PackagesNotFoundError: The following packages are not available from current channels:
- python=3.4
I tried to change the version to 3.7, typing conda create -n myenv python=3.7
There was no error with version 3.7. So the problem seems to be related with the older versions of python.
This is the full output with the error message:
Collecting package metadata (current_repodata.json): done
Solving environment: failed
Collecting package metadata (repodata.json): done
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- python=3.4
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
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.
回答1:
The reason you are not able to install python 3.4
package is that it is not available in the default channel of anaconda from where you are trying to install.
However, I just check that it is available in the conda-forge
channel. So, it can be installed as below:
conda create -n myenv python=3.4 -c conda-forge
回答2:
It seems to me that Python 3.4 is not available in any of your listed repositories. I've tried to create an environment with it in Anaconda and it worked. Try to update Miniconda first:
conda update -n base -c defaults conda
If it does not work, look for a repository containing Python 3.4 and add it to your list of repositories.
回答3:
what you can try is update and search python interpreter versions:
Step1:
conda update conda
Step2:
conda search "^python$"
It will list all the available versions:
python 3.4.0 0 defaults
python 3.4.1 0 defaults
python 3.4.1 1 defaults
python 3.4.1 2 defaults
python 3.4.1 3 defaults
python 3.4.1 4 defaults
python 3.4.2 0 defaults
python 3.4.3 0 defaults
python 3.4.3 2 defaults
python 3.4.4 0 defaults
python 3.4.4 5 defaults
python 3.4.5 0 defaults
Then install based on the existing versions.
来源:https://stackoverflow.com/questions/56850972/why-conda-cannot-create-environment-with-python-3-4-installed-in-it