Import cv2 ModuleNotFoundError: No module named'cv2' in python3

Overview

I had a pyhton program using opencv that I wanted to run a little, so It was executed as follows.

python3 "The program you want to run.py"

Then I got the following error

Traceback (most recent call last):
  File "The program you want to run.py", line 21, in <module>
    import cv2
ModuleNotFoundError: No module named 'cv2'

environment

Solution

I executed the following command referring to This page of Qiita.

pip install opencv-python

Then check if it can be imported again

>>> import cv2
>>> print( cv2.__version__ )
4.4.0
>>> 

did it.

It was cold yesterday November 7, 2020

Recommended Posts

Import cv2 ModuleNotFoundError: No module named'cv2' in python3
ModuleNotFoundError in Python: No module named story
Import Error in Python3: No module named'xxxxx'
ModuleNotFoundError: No module named'_bz2' error in pyenv Python
[Python] ModuleNotFoundError: No module named'urlparse'
Python error: ModuleNotFoundError: No module named'flask'
ModuleNotFoundError in poetry: No module named'setuptools'
Python module import
Today's python error: ModuleNotFoundError: No module named
Today's python error: ModuleNotFoundError: No module named'requests'
Module import and exception handling in python
Today's python error: ModuleNotFoundError: No module named'bs4'
What to do when ModuleNotFoundError: No module named'XXX' occurs in Python
ModuleNotFoundError: No module named'py4j'
ModuleNotFoundError: No module named'flask_sqlalchemy'
Dynamically import scripts in Python
What to do if you get Swagger-codegen in python and Import Error: No module named
[Python] logging in your own module
Working with LibreOffice in Python: import
There is no switch in python
Python unittest module execution in vs2017
[Question] No module named'Selenium' in PyCharm
Master the weakref module in Python
I get "sanity check" and "No module" errors in import numpy
How to resolve ModuleNotFoundError: No module named XXX in Jupyter Notebook
Why ModuleNotFoundError: No module named'dataset.mnist' appears in "Deep Learning from scratch".
Suddenly with Python PyInstaller No module named pyinstaller
Microsoft Cognitive Toolkit: ModuleNotFoundError: No module named'cntk._cntk_py'
Implementation module "deque" in queue and Python
Revived from "no internet access" in Python
Comparison of Japanese conversion module in Python3
In python + sqlite3 "OperationalError: no such column:"
[Python] Import the module one level higher
Module to generate word N-gram in Python
ModuleNotFoundError: No module named'***' when running Flask
Install the Python module in any directory
Upgrading Python module in OSX El Capitan
Wall to put OpenCV 3.1.0 in raspberry pi 3 and run sample on python3: ImportError: No module named cv2 solution
Solution for "Import Error: No module named requests"
Summary of how to import files in Python 3
Use cryptography module to handle OpenSSL in Python
To add a module to python put in Julialang
Import your own modules in Grasshopper's Python development
Difference in object ID due to import in Python
Parallel processing with no deep meaning in Python
Solution when module'XXX' has no attribute'XXX' in Python
About Python external module import <For super beginners>
Quadtree in Python --2
Python in optimization
CURL in python
Metaprogramming in Python
Python 3.3 in Anaconda
SendKeys in Python
Epoch in Python
Discord in Python
Sudoku in Python
DCI in Python
Import python script
quicksort in python
nCr in python
N-Gram in Python