🐍 Fix ModuleNotFoundError (No Module Named CV2) Python Import Error (If Installed / If Exists)

Поділитися
Вставка
  • Опубліковано 6 лис 2024

КОМЕНТАРІ • 34

  • @cheesywiz9443
    @cheesywiz9443 Рік тому

    the only video that helped.. thank you so much!

  • @muhammadhanifhanif8763
    @muhammadhanifhanif8763 Рік тому +27

    i have done all this what you have told but I'm still having the same error even though I've only python 3 version

  • @0tispunkm3y3r
    @0tispunkm3y3r Рік тому +10

    I have just installed python 3, fresh, never installed or even used python before. Pip list shows opencv-python there in the list and when trying to use import cv2, it gets the module error. As a complete novice now. i don't know what to do. This really is the kinda crap that keeps stuff like this and Linux away from people. Its too much fucking about making it work rather than using it to do something useful. Good job my work pays for Matlab!

    • @0tispunkm3y3r
      @0tispunkm3y3r Рік тому +2

      Fixed it.
      The problem: I installed python. Then I installed Spyder IDE. Spyder comes with its own Python install (interpreter) and its basically looking at packages installed into its own location rather than the python you originally installed.
      So you call pip list in the cmd.exe window and you can find "opencv-python". If you run pip list in the terminal from Spyder... its not there. So you have this disconnect of thinking you installed everything and it not working.
      The fix: In Spyder - Tools -> Preferences -> Python Interpreter -> Switch from "default" (which uses Spyders version of python" and select "use the following". Then just navigate to where your actual python install is and then re-start Spyder.
      I guess the same goes for any other IDE that curiously comes with its own python interpreter pre-packaged.

  • @oliverodqvist9373
    @oliverodqvist9373 Рік тому +16

    I fixed it by pressing on the bottom right of vscode where it shows the version then selecting the other one that was available, this then allowed me to use cv2 and my other module which also wasn't working before

    • @moosem30
      @moosem30 Рік тому

      bruuh worked for me too after trying everything else

    • @hi_sofia
      @hi_sofia Рік тому

      it works! omg thank you!

    • @YourDepression1
      @YourDepression1 11 місяців тому

      You're the goat. For me, it seems that VSC wasn't using the right python root, and it was using some Microsoft Store Version? lol

    • @marisoltolentino3034
      @marisoltolentino3034 11 місяців тому

      THANKS A LOT!!!! IT WORKS

    • @mcbigcheese7327
      @mcbigcheese7327 10 місяців тому

      I've had this problem for like a year thank you so much

  • @romanx7595
    @romanx7595 Рік тому +3

    my pip and pip3 have the same python 3.11 and on pip list have opencv installed but still have ModuleNotFoundError: No module named 'vc2'

    • @gauravm2189
      @gauravm2189 Рік тому +1

      Now have you solved this problem 😢?

  • @josephmalagari452
    @josephmalagari452 Рік тому

    Everything is installed and when I run the code it just doesn’t pull the excel file up. I have it to print the cells and that works just fine, but it just doesn’t pull the file up. Any ideas?

  • @iriswang2772
    @iriswang2772 Рік тому

    so helpful! it took me 1.5 hours finally figuring out with the vid

  • @ayazfarooqui3832
    @ayazfarooqui3832 Рік тому

    I want to use openCV to control camera on my PC using Python and new to this library, so please bear with me if I have posted something out of norm for this post. I have installed C:\Users\...\ppData\Local\Programs\Python\Python38-32\Lib\site-packages\opencv_python-4.7.0.68.dist-info using the pip command in CMD and added it windows path, but when call #import cv , it say module not found in a simple "hello world" python code. I have python 3.8.1 installed on my windows 11. I have run the pip list command and can see the openCV package is there as installed. And when try to re-install it, it says that it's already installed, so I don't why it's failing the call to it in the script? I don't python 2 on my machine. Any help will greatly appreciated!

    • @teeboogiee504
      @teeboogiee504 9 місяців тому

      Same bro n nobody is helping

  • @halfsoul1241
    @halfsoul1241 11 місяців тому

    Thank you so much it worked ✌️

  • @gojo1825
    @gojo1825 2 місяці тому

    Goat 🐐

  • @yertargynberdibek
    @yertargynberdibek 7 місяців тому

    Полезно, но не помогло!!!

  • @esaiselvam5320
    @esaiselvam5320 2 роки тому

    yes i tried all methods that you have showed , still it didnt work to me, even i have only python3 in my system, kindly help

    • @ghosttogether
      @ghosttogether  Рік тому +3

      Usually this happens because you installed modules with another pip, into another environment. But trying to run it with python from current environment. If you're using VSCode, install Python extension, it will have a button in the bottom tray, click on it to change Python Environment/version. (VSCode will automatically identify all installed versions of Python, so that's the fastest way to figure this out.)

    • @astreroid118
      @astreroid118 Рік тому

      @@ghosttogether Thank you so much for this comment. I've been trying to figure this out for a week now and your video was very helpful!

  • @manhkienton3403
    @manhkienton3403 Рік тому

    tks for the helpful your helpful video

  • @DrLanli
    @DrLanli Рік тому

    Thanks a lot