IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 人工智能 -> anaconda安装opencv -> python[version=‘>=2.7<2.8.0a0|>=3.5<3.6.0a0|>=3.6<3.7.0a0|>=3.7<3.8.0a0‘] -> 正文阅读

[人工智能]anaconda安装opencv -> python[version=‘>=2.7<2.8.0a0|>=3.5<3.6.0a0|>=3.6<3.7.0a0|>=3.7<3.8.0a0‘]

系统崩溃,机器重新装, 同样的配置和安装,突然报错,

Collecting package metadata (current_repodata.json): done
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.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: -?
Found conflicts! Looking for incompatible packages.
This can take several minutes. ?Press CTRL-C to abort.
failed ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

? - opencv -> python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0']

Your python: python=3.8

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

The following specifications were found to be incompatible with your system:

? - feature:/linux-64::__glibc==2.27=0
? - feature:|@/linux-64::__glibc==2.27=0
? - opencv -> libgcc-ng[version='>=7.2.0'] -> __glibc[version='>=2.17']

Your installed version is: 2.27

官方推荐的办法是

https://github.com/pytorch/vision/issues/3207

pip install opencv-contrib-python

发现如果用
conda install -c conda-forge opencv
会有一大堆不兼容。

顺便说一下,以前有说把python降到3.5版本的,我长时间用3.7和3.8,都没有问题,今天突然报错,反而很奇怪。又搜索了一下,网上有详细介绍兼容性安装的,内容如下,有时间大家可以自己去搜索对比一下,以避免冲突,

Anaconda 2020.11 issue with OpenCV

Recently I installed?Anaconda?2020.11 on my Mac machine. When I tried to installed?opencv?package, it showed errors. Below is the error excrept:

$ conda install -c conda-forge opencv
Collecting package metadata (current_repodata.json): done
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.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - opencv -> python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0']

Your python: python=3.8

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

Above error suggested that opencv package in the current repository is only supported with python version?<3.8.0a0. After googling for a bit, I found many different solution but none of them worked in my case. My conda details:

$ conda info
     active environment : pandas
    active env location : /Users/user-abc/anaconda3/envs/pandas
            shell level : 1
       user config file : /Users/user-abc/.condarc
 populated config files : /Users/user-abc/.condarc
          conda version : 4.9.2
    conda-build version : 3.20.5
         python version : 3.8.5.final.0
       virtual packages : __osx=10.15.7=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /Users/user-abc/anaconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/user-abc/anaconda3/pkgs
                          /Users/user-abc/.conda/pkgs
       envs directories : /Users/user-abc/anaconda3/envs
                          /Users/user-abc/.conda/envs
               platform : osx-64
             user-agent : conda/4.9.2 requests/2.24.0 CPython/3.8.5 Darwin/19.6.0 OSX/10.15.7
                UID:GID : 502:20
             netrc file : None
           offline mode : False

So, I started searching for availble python versions of conda:

$ conda search python
Loading channels: done
# Name                       Version           Build  Channel
python                        2.7.13     h32f5f24_13  pkgs/main
python                        2.7.13     h89fad4f_16  pkgs/main
python                        2.7.13     hdada7c8_15  pkgs/main
...
python                         3.7.4      h359304d_1  pkgs/main
python                         3.7.5      h359304d_0  pkgs/main
python                         3.7.6      h359304d_2  pkgs/main
python                         3.7.7 hc70fcce_0_cpython  pkgs/main
python                         3.7.7      hf48f09d_4  pkgs/main
python                         3.7.7 hfe9666f_0_cpython  pkgs/main
python                         3.7.9      h26836e1_0  pkgs/main
python                         3.8.0      h359304d_0  pkgs/main
python                         3.8.0      h359304d_1  pkgs/main
python                         3.8.0      h359304d_2  pkgs/main
python                         3.8.1      h359304d_1  pkgs/main
python                         3.8.2      hc70fcce_0  pkgs/main
python                         3.8.2     hf48f09d_13  pkgs/main
python                         3.8.2      hfe9666f_0  pkgs/main
python                         3.8.3      h26836e1_1  pkgs/main
python                         3.8.3      h26836e1_2  pkgs/main
python                         3.8.5      h26836e1_0  pkgs/main
python                         3.8.5      h26836e1_1  pkgs/main
python                         3.9.0      h88f2d9e_1  pkgs/main
python                         3.9.0      h88f2d9e_2  pkgs/main
python                         3.9.1      h88f2d9e_2  pkgs/main

Then, searched for available?opencv?package.

$ conda search opencv
Loading channels: done
# Name                       Version           Build  Channel
opencv                         3.3.1  py27h2dac755_0  pkgs/main
opencv                         3.3.1  py27h4e978fd_0  pkgs/main
opencv                         3.3.1  py27h60a5f38_1  pkgs/main
...
opencv                         3.4.2  py36h40b0b35_1  pkgs/main
opencv                         3.4.2  py36h6fd60c2_0  pkgs/main
opencv                         3.4.2  py36h6fd60c2_1  pkgs/main
opencv                         3.4.2  py37h40b0b35_0  pkgs/main
opencv                         3.4.2  py37h40b0b35_1  pkgs/main
opencv                         3.4.2  py37h6fd60c2_0  pkgs/main
opencv                         3.4.2  py37h6fd60c2_1  pkgs/main

Look at the last row. Check?py37h6fd60c2_1

opencv                         3.4.2  py37h6fd60c2_1  pkgs/main

This confirmed that the latest opencv package is built with py37 packages and hence it is not installable with python3.8.

Now the most tempting thing to do is to downgrade python version.

$ conda install python=3.7

Wait, this is going to take lot of time and in last will show multiple conflicts which is not easy to resolve.

So, what is the?simple solution?? Virtual environment comes to rescue. By default, anaconda runs in environment name?“base”. If you are familiar with python, we have package called?virtualenv?to create virtual environment. The same thing we can do here with?conda.

Steps:

conda create -n myenv python=3.7	# This will create a virtual environment named myenv with python3.7
conda activate myenv
conda install -c conda-forge opencv

另外的参考内容,

python - Installing OpenCV with Conda and Spyder - Stack Overflow

conda update -n base -c defaults conda
conda install -c conda-forge opencv

  人工智能 最新文章
2022吴恩达机器学习课程——第二课(神经网
第十五章 规则学习
FixMatch: Simplifying Semi-Supervised Le
数据挖掘Java——Kmeans算法的实现
大脑皮层的分割方法
【翻译】GPT-3是如何工作的
论文笔记:TEACHTEXT: CrossModal Generaliz
python从零学(六)
详解Python 3.x 导入(import)
【答读者问27】backtrader不支持最新版本的
上一篇文章      下一篇文章      查看所有文章
加:2022-03-11 22:11:31  更:2022-03-11 22:13:34 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/26 15:36:57-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码