English version:how to import cv2,influenced by

After typing import cv2 in the python file

the error is

Traceback (most recent call last):
  File "C:/Users/郑安学/PycharmProjects/pythonProject3/task1.py", line 1, in <module>
    import cv2
ModuleNotFoundError: No module named 'cv2'

After searching, there are the following problems

1. The parent package of cv2, opencv-python, should be imported.

2. the computer is affected by the virtual environment because it has downloaded Anaconda.

3. there are multiple versions of python on the computer, so the path to the package is affected by multiple downloads and uninstallations

So we need to specify the intepreter path to download cv2 package

First of all, find the download path of cv2

Get the path to cv2

 

 

 

Copy this section

Then in the settings find

Show All

Click on the 

 

 Click on the circle, click ➕ Add interpreter paths, and paste the copied paths into it

 

apply 
————————————————

原文链接:https://blog.csdn.net/EchoAnnnn/article/details/126523073

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值