K
K
kgaudium2018-07-06 23:51:18
Python
kgaudium, 2018-07-06 23:51:18

Why doesn't python 3.6.6 see the opencv library?

I installed opencv on python 3.6.6, in console it is imported:

Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD6
4)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2

And when I try to open through the saved file, the error appears:
D:\pyneural>opencv.py
Traceback (most recent call last):
  File "D:\pyneural\opencv.py", line 1, in <module>
    import cv2
ModuleNotFoundError: No module named 'cv2'

How to fix?
PS anaconda not installed

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GilbertAmethyst, 2018-07-06
@kgaudium

Check if you are running the same Python, if two are suddenly installed on the system.

S
sim3x, 2018-07-06
@sim3x

Activate the virtual environment where opencv
is installed Set the path to the python from the virtual environment where opencv is installed in the shebang
Run the script with the path to the python from the virtual environment where opencv is installed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question