简体   繁体   中英

How to fix "UnsatisfiableError: The following specifications were found to be incompatible with each other: - pip -> python=3.6"

So, i trying to install with the command ecmwf api client conda install -c conda-forge ecmwf-api-client then the warning in the title shows up. I don't know how to proceede

(base) C:\Users\caina>conda install -c conda-forge ecmwf-api-client Collecting package metadata (current_repodata.json): done Solving environment: failed Collecting package metadata (repodata.json): done Solving environment: failed

UnsatisfiableError: The following specifications were found to be incompatible with each other:

  • pip -> python=3.6

Install into a new environment instead of the conda base environment. Recent Anaconda and Miniconda installers have Python 3.7 in the base environment, but you're trying to install something that requires Python 3.6.

I came across this error when I was accidentally running conda env create -f environment.yaml within another activated conda environment. So, deactivating environment then re-running conda create fixed the issue

conda deactivate 
conda env create -f environment.yaml

As others have said, it's recommended to create a new, clean environment and conda install into that.

This can be done with the following:

# Create new environment
conda create --name <name> python=3.6
# Activate new environment
conda activate <name>
# Install packages into new environment
conda install -c conda-forge ecmwf-api-client

It's a good idea to keep various environments for different projects. You can then use conda deactivate / conda activate <name> and install any packages into the correct environment. This also allows you to easily swap between different versions of python, or individual software packages.

  1. Simply go to Anaconda navigator.
  2. Go to Environments, Select Installed (packages, etc.) and then click the version of Python. Downgrade it to a lower version. In your case Python 3.6

Don't know if you managed to fix this but in case some others got stuck here is the solution that I found:

Just simply used pip3 inside of conda env. It has installed opencv for python3.6 without any issue:

pip3 install opencv-python

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM