: on January 21, 2018, at 10:13 PM, I excitedly uploaded my CSDN blog from the Ubuntu system and sent an congratulatory message. I congratulated myself on solving the problem of ImportError: No module named cv2. It is like a phone call from another world (Ubuntu world) to the real world (Windows world).
it started a long time ago at 4:30 PM, when I was just a kid, a naive kid, getting ready to run a fast r-cnn demo on my Ubuntu system. Of course, the purpose is to test my caffe environment. This demo is the training model on Github, I won’t go into details, you can refer to this blogger’s tutorial, which is simple and clear. I won’t say.
my setup environment is
ubuntu14.04 p>
caffe p>
opencv 3.0.0 – beta p>
anaconda2
p>
but when you run the last step
./demo.py --cpu
suddenly appeared an error, the initial error can not find easydict module (
ImportError: No module named easydict
sudo pip install easydict
easydict installation, but still prompt can not find, actually this sentence after running if successful installation should be in your/usr/local/lib/python2.7 dist – packages folder has a easydict folder, but this time when wrong, because you try to run again./demo. Py – CPU, still can appear the error, That’s because easydict should be on your home/anaconda2/lib/python2.7/site – under the packages folder, why, that’s because the configuration of the environment on with me, because my python with the anaconda and not the python, so be it.
ImportError: No module named cv2
and then the main thing, which is that cv2 can’t be found, and I’m going to just say the solution here, just to give you a sense of perspective, is that when I come across this problem, I go from being a kid, a naive kid, to being a car brother.
step 1:
install python – opencv p>
sudo apt-get install python-opencv
See if it’s resolved. If it’s not resolved, look at step 2.
step 2:
find cv2. So copying files to your/usr/local/lib/python2.7 site – packages folder (in the case of no use you anaconda), how to find your cv2. So, I offer a very convenient method (must use this method, or you not seek) : p>
find/-name "cv2.so"
and then on the terminal CD to home, type python, python version number and so on, and then
>>>import cv2
If there is no error, the problem is solved.
in the absence of anaconda, by this point it should have been completely resolved, and if you haven’t resolved it yet, look at step 3:
step 3:
see the third step that USES the anaconda, find cv2 through the second step. So, reproduction cv2. So to home/anaconda2/lib/python2.7/site – packages folder, and then the second step, input the python, then input the import cv2. Just fine.
thank you! My show is over! Please enjoy the picture:
Read More:
- ImportError: No module named indexes.base
- Python:ImportError: No module named indexes.base
- Importerror: no module named typing error reporting solution (python2 PIP needs to be backed back from 21)
- ImportError: dynamic module does not define module export function (PyInit_cv_bridge_boost)
- Importerror of Django error: no module named**
- Module not found error: the solution to the problem of no module named ‘MySQL’
- AttributeError: module ‘cv2.cv2‘ has no attribute ‘face‘
- How to solve “import cv2 failed ImportError: DLL load fail: Cannot find the specified module” in Anaconda environment
- Jenkins reported an error modulenotfounderror: no module named filename solution
- ModuleNotFoundError: No module named ‘numpy.testing.nosetester‘
- Module not founderror: no module named ‘nets.ssd‘
- Record pyinnstaller package file execution error modulenotfoundererror: no module named ‘cmath’ solution
- When VS code imported Cv2, an error ImportError: numpy.core.multiarray failed to import; There are no mistakes in using the Spyder
- [solution] a perfect solution to the problem of failed to load module “Canberra GTK module” in Ubuntu
- Error importing keras in jupyter Notebook: modulenotfounderror: no module named ‘keras’ solution
- matplotlib error – no module named tkinter
- ModuleNotFoundError: No module named xxx
- Modulenotfounderror: no module named ‘CV2’ – (version problem)
- How to Fix gdb error: Failed to import the site module,No module named ‘_sysconfigdata_m’
- Tensorflow operation report error modulenotfounderror: no module named ‘tensorflow. Python. Types’ solution