Skip to content
Advertisement

Module not found error but I have pip installed the module

I have correctly pip installed the module, but I am still getting an error and I am not sure why.

My Code:

21:from Crypto.Cipher import AES

22:from PIL import ImageGrab

23:from win32crypt import CryptUnprotectData

Error is: File “main.py”, line 21, in ModuleNotFoundError: No module named ‘Crypto’

(I am an amateur btw)

Advertisement

Answer

Try this, also be aware of where are you running the pip command, sometimes you need to run it in the CMD other times it is OK in the terminal or your IDE.

# 👇️ in a virtual environment or using Python 2
pip install your_package

# 👇️ for python 3 (could also be pip3.10 depending on your version)
pip3 install your_package

# 👇️ if you get permissions error
sudo pip3 install your_package

# 👇️ if you don't have pip in your PATH environment variable
python -m pip install your_package

# 👇️ for python 3 (could also be pip3.10 depending on your version)
python3 -m pip install your_package
Advertisement