简体   繁体   中英

I can't import cv2,vlc and numpy python pycharm

I can't import modules in pycharm. When I wanted to import cv2 for example, I get this error:

Please can somebody help me. I tried all other solutions but they did not help

You should write this in terminal or cmd and than try:

pip install opencv-python

here is more info: How to import cv2 in python3?

From the image you uploaded it seems like you are using a virtual environment. If that was intended make sure you have installed opencv in your environment. Otherwise you can change the interpreter for the project by going to:

"File" --> "Settings" --> "Project: project_name" --> "Project Interpreter"

From there you can change or add an interpreter and see what packages are attached to the interpreter. See example below:

在此处输入图片说明

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