我正在尝试在PyCharm中导入cv2
模块,但是出现了错误。我也尝试在终端执行该操作。
pip install opencv-python
pip3 install cv2
pip install opencv-python
pip3 install cv2
尝试从终端安装opencv-python时,会显示以下内容。
Requirement already satisfied: opencv-python in ./anaconda3/lib/python3.6/site-packages (3.4.1.15)
尝试从终端安装cv2
时会显示以下内容
Could not find a version that satisfies the requirement cv2 (from versions: )
No matching distribution found for cv2
然而,在Pycharm中尝试导入cv2
时会显示如下错误:
Pycharm错误图片
opencv-python
,就像pip install cv2
一样,但他需要像pip install opencv-python
一样安装它。 - Druta Ruslanconda install cv2
? - Alex YuPyCharm
- 在项目设置中为您的项目创建新环境。 - Alex Yu