安装软件包开始运行一些代码可能是我工作中最难的部分。
Anways,我尝试在anaconda python 3.6环境中安装opencv。我收到错误:
conda install -c conda-forge opencv
Fetching package metadata ...........
Solving package specifications: ..........
Package plan for installation in environment C:\Program Files\Anaconda3\envs\py36:
The following packages will be downloaded:
package | build
---------------------------|-----------------
libwebp-0.5.2 | vc14_7 1.1 MB conda-forge
opencv-3.2.0 | np112py36_204 92.0 MB conda-forge
------------------------------------------------------------
Total: 93.1 MB
The following NEW packages will be INSTALLED:
libwebp: 0.5.2-vc14_7 conda-forge [vc14]
opencv: 3.2.0-np112py36_204 conda-forge
Proceed ([y]/n)? y
Fetching packages ...
libwebp-0.5.2- 100% |###############################| Time: 0:00:05 213.41 kB/s
opencv-3.2.0-n 100% |###############################| Time: 0:00:48 1.97 MB/s
Extracting packages ...
[ COMPLETE ]|##################################################| 100%
Linking packages ...
PaddingError: Placeholder of length '34' too short in package conda-forge::opencv-3.2.0-np112py36_204.
The package must be rebuilt with conda-build > 2.0.
我在Windows系统上。我不明白错误,搜索没有帮助。
欢迎任何有关解决错误的意见或建议。
答案 0 :(得分:3)
为了记录,OpenCV与pip
安装良好。
使用Miniconda和Python 3.6在Windows 10上进行测试:
> pip search opencv
...
opencv-python
...
> pip install opencv-python
告诉我Requirement already satisfied
。
要确保已正确安装,请运行:
> python
>>> import cv2
>>>
答案 1 :(得分:0)
转到root conda环境。
做conda update conda
。
然后只需import cv2
并使用它。