How to fix ModuleNotFoundError: No module named ' ' in Python on Windows, Linux, and macOS

preview_player
Показать описание
This video will show you how to fix ModuleNotFoundError: No module named ' ' when using importing packages or modules in Python. I will go over fixing the error on Windows, Linux, and macOS. We will fix the issue by looking at three solutions to common problems. The first is installing the package or module using pip. If that does not work, then we will verify the installation path for the package or module. This step can be helpful if you have multiple versions of Python installed like Python 3.6, 3.7, 3.8, and 3.9. If after these steps, you are still getting the same error, we will see if any virtual environments are being used. Often people will install packages inside of virtual environments and then try to run their programs outside of the virtual environment. This will not work since all of the packages have been installed in the virtual environment. A similar issue can occur when people do not activate their environments before starting their programs.

00:00 Installing packages and modules using pip
00:30 (macOS) How to use pip
00:58 (Linux) How to use pip
01:12 (Windows) How to use pip
01:44 Using pip in text editors and IDEs
01:55 command not found/is not recognized as an internal or external command
02:12 Package/module not in the Python Package Index (PyPI)
02:22 Multiple Python installations
03:39 (Windows) How to check if you have multiple versions of Python installed
03:56 (macOS) How to check if you have multiple versions of Python installed
04:11 (Linux) How to check if you have multiple versions of Python installed
04:23 (macOS/Linux) Installing packages using specific versions of Python
04:36 (Windows) Installing packages using specific versions of Python
04:48 Virtual Environments
05:24 How to use pip with virtual environments

Рекомендации по теме
Комментарии
Автор

This was a huge help- I couldn't figure out why a module wouldn't import, even though I had installed it. Yours was the only video I could find that mentioned installing separately in the virtual environment- once I did that, it worked perfectly. Thanks so much!

roman
Автор

Thanks man been searching for the soln for hours, this is the only place I found exactly what I needed

manuelqoshgaming
Автор

I can not thank you enough. I was getting crazy here, and you saved the day. Thanks again.

moodysamy
Автор

That background makes me feel like an astronaut in the ocean

livvy
Автор

Thank You Alfredo Sequeida. Thank You so much.

Mahde
Автор

Alfrado. On linux I'm doing conda env create -f environment.yml. This command runs into a problem because when it uses python -m /path/pip instead of python -m pip. It is causing the ModuleNotFoundError with the first 2 subdirectories of path. I am using python3.8. Why it is tagging the path to pip onto its name is what I am trying to figure out. I can recreate this problem using python -m /path/pip. Any ideas?

modocdance
Автор

Thanks so much Sir, u are a life saver and yours tutorial is one of a kind

abdulazeezabdulakeem
Автор

thank you very much you helped me a lot

darckobelix
Автор

Doesn´t work with bullseye on Rapsberry pi 4 but thank you dude (y)

davidaugustotrde