Usually the red report after import is because there is no module, use pip install cv2 to download the module, it will appear:
Could not find a version that satisfies the requirement cv2 (from versions: )
No matching distribution found for cv2
You are using pip version 18.1, however version 19.0.2 is available.
You should consider upgrading via the ‘python -m pip install –upgrade pip’ command.
At this point you need to type python -m pip install –upgrade pip
When the installation is complete, run this line “pip install opencv-python”, this line is to install the cv2 module, wait until the download is complete
To install the numpy module, you only need to pip install numpy
The summary is as follows:
python -m pip install --upgrade pip pip install opencv-python pip install numpy
- How to Fix Errors encountered in executing Python scripts with command line parameters
- [Solved] module ‘numpy.random‘ has no attribute ‘default_rng‘ gensim.model
- [Solved] opencv-python: recipe for target ‘modules/python3/CMakeFiles/opencv_python3.dir/all‘ failed
- [How to Solve] ImportError: No module named typing
- npm install Error: stack Error: Can’t find Python executable “python”
- Mac Upgrade pip Error OSError: [Errno 13] Permission denied: ‘/Library/Python/2.7/site-packages/pip-9.0.1-py2….
- [Solved] AttributeError: module ‘logging‘ has no attribute ‘Handler‘
- [Solved] Ubuntu18.04 Install pyqt5 error: Command “python setup.py egg_info“ failed with error code 1 in /tmp/pip-build-92
- How to Solve Turtle_tf Error in ROS
- Python 3 urllib has no URLEncode attribute
- [Solved] Django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required (found 3.7.17).
- Python error collection: NameError: name ‘numpy’ is not defined
- [Solved] Cv2.imshow Error: window.cpp:1274: error: (-2:Unspecified error) The function is not implemented.
- [Solved] Pyinstaller package opencv error: ImportError: OpenCV loader: missing configuration file: [‘config.py’]. Check OpenCV installation.
- [Mac Pro M1] Python3.9 import cv2 Error: Reason: image not found
- [Solved] ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
- [Solved] Import cv2 Error: ImportError: libGL.so.1: cannot open shared object file: No such file or directory
- PyCharm: How to Solve Tensorflow_datasets Import Error
- Python 2.7: How to Install PIP
- Using Python error urlopen error unknown URL type: the solution of HTTPS