No module named 'cv2' error in new environment

折月煮酒 提交于 2021-01-29 14:16:21

问题


I have tried to rectify this issue by using

pip install opencv-python

pip install opencv-contrib-python

pip uninstall panda
pip install panda

conda install opencv-python

Some info is that im currently using python 3.6.10 and Windows 10.

opencv-python        4.2.0.32
numpy                1.18.1
panda                0.3.1
tensorflow-gpu       1.14.0

I created a new env but cant seem to import cv2 over on Jupyter Notebook. My earlier environment was able to do so. When i tried to pip install the opencv-python==4.1.2.30 (from the old environment's pip list), the problem was still there. Thank you for reading!


回答1:


Firstly check which pip you are using

which pip # for linux
where pip # for windows

If path is in your new enviroment then try to reinstall it else first set PATH of new enviroment pip to the terminal/command prompt.




回答2:


I found the elementary mistake I made. I forgot to download jupyter notebook in my env. As a result, I think it brought me to the another directory which doesn't have opencv. Thank you pygirl and nitr_himanshu for your help!



来源:https://stackoverflow.com/questions/60351225/no-module-named-cv2-error-in-new-environment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!