Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named cv #143

Open
pittebidde opened this issue May 10, 2023 · 2 comments
Open

ImportError: No module named cv #143

pittebidde opened this issue May 10, 2023 · 2 comments

Comments

@pittebidde
Copy link

TL:DR: If you get the Problem "ImportError: No module named cv2" or similar, it could be because your virtual enviroment does not yet have the library. you might need to install the needed libraries (opencv and numpy) locally in your virtual env. via command prompt.

I already solved this problem by myself, but since i haven't found any similar Issues in the "Issues Tab" yet, i might as well document my problem

When you create a virtual environment, your global libraries are not connected to your virtual environment setup.
So if you try to import them, they won't find the library.

My solution (i dont know if it is a particulary clean one), was to:

  1. open the command promt
  2. activate your virtual environment (in my case it was windows, so i typed in ".\tfod\Scripts\activate")
  3. install the libraries locally (you need not only opencv, but also numpy because it is also used in opencv)
    meaning i typed into the virtual environment command line:
    pip install opencv-python
    and
    pip install numpy
@GunSY
Copy link

GunSY commented Mar 3, 2024

I am getting this error No module named 'numpy._utils'
I have uninstalled and then reinstalled numpy lib, but the errors are still there.
Pip list also showing I have the lib installed.
error

error-1

@GunSY
Copy link

GunSY commented Mar 3, 2024

Can you let me know what has happened?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants