问题
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