简体   繁体   中英

Why doesn't OpenCV get installed on the base (root) environment of Anaconda?

After installing Anaconda , at first, I installed tensorflow with conda, then I tried to install opencv with the following conda commands:

conda install -c conda-forge opencv
conda install -c conda-forge/label/gcc7 opencv
conda install -c conda-forge/label/broken opencv
conda install -c conda-forge/label/cf201901 opencv
conda install -c conda-forge/label/cf202003 opencv

But, none of the avobe worked, it failed to install opencv on my base (root) environment. (However, I became able to install it on a different environment.)

The error message I got is:

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.

I also tried to install opencv with Anaconda Navigator on base (root) environment. But, it didn't work also.

Then, I tried to install opencv with pip with the following commmand:

pip install opencv-python

But, it also didn't work.

Now, How can I install opencv on my base (root) environment?

Your (partial) error message (from the comments):

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.

and the fact that you were able to install it into a different environment:

However, I became able to install it on a different environment.

Indicate that you have conflicts with other packages in your base environment, ie conda was not able to determine how to fit opencv and its dependencies together with other packages in your base environment.

The best practice here would be to set up a new environment and only install the packages that you need for a certain project.

Alternatively, you could also uninstall anaconda and install miniconda (which is the same as aanconda, but without the preinstalled packages) and then install into base only what you need.

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