No module named 'PIL' althought the installing command - python

When I write from PIL import Image I get this error :ModuleNotFoundError: No module named 'PIL'
So I wrote many times in my cmd : pip import pillow and he shows me that : Requirement already satisfied: pillow in c:\users\rusti\appdata\local\programs\python\python39\lib\site-packages (8.2.0)
I also tried to refresh my desktop, and to restart my IDLE.
I have no idea where the error comes from...

Related

Error message running python code in VS code: No module named "openpyxl"

So I am using VS code on Mac. I'd like to read .xls file on python. I have installed openpyxl package using code: python3 -m pip install openpyxl. But when I try to run import openpyxl, I get an error: ImportError: No module named openpyxl. When I tried to install the package once more, I got a message: Requirement already satisfied: openpyxl in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages.
So I don't know, why the package can't be imported. Can anyone help me out?

Module pyfiglet not found

The code :
import pyfiglet
print(dir(pyfiglet))
The error :
ModuleNotFoundError: No module named 'pyfiglet'
Even though I downloaded "pip 21.0.1" and imported it, it does the same thing to "termcolor" package.
sorry i install pip and the command
pip install pifiglet
report this results
equirement already satisfied: pyfiglet in /usr/local/lib/python3.9/dist-packages (0.8.post1)
but if i do the original command i have this response
from pyfiglet import figlet_format
ImportError: cannot import name 'figlet_format' from 'pyfiglet' (/usr/local/lib/python3.9/dist-packages/pyfiglet/init.py)
but in this path there is the file...
Before you can import a library, it needs to already be on your drive. You are importing it into your file. In order to get it onto your drive in the first place, you have to install it.
From the command prompt, type:
pip install pifiglet
Once you've done that, you should be able to import it.

ImportError: No module named PyQt5 : python3

I was trying to learn how to use PyQt5 but at the moment that i want to run my code i got this error
ImportError: No module named PyQt5
I searched about it and i try all the possible solutions but im not able to fix it.
When i run
pip3 install PyQt5
I get this
Requirement already satisfied: PyQt5 in /usr/lib/python3/dist-packages (5.12.3)
And if i run
python --version
I get
Python 3.7.5
Now i dont know what to do. I'm using Pop_OS 19.10

cannot import module "cv2" in python on mac

I'm trying to use opencv-python. I imported with pip but it throws ModuleNotFound.
Joshua-Tews-MacBook-Pro:~ nathan$ pip install opencv-python
Requirement already satisfied: opencv-python in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (4.0.0.21)
Requirement already satisfied: numpy>=1.14.5 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from opencv-python) (1.16.2)
I import with this:
import cv2
I get this error:
Traceback (most recent call last):
File "/Users/nathan/Library/Mobile Documents/com~apple~CloudDocs/CEP/Y4/Capstone Project (Security Cameras System)/cep-ml-capstone/VideoProcessor.py", line 1, in <module>
import cv2
ModuleNotFoundError: No module named 'cv2'
I've look at the answers on this stackoverflow thread, none seem to help: Cannot import cv2 in python in OSX
Others have solutions I completely didn't recognise pertaining to other OS so I skipped those.
Okay I apparently I just had to run the script with Python 3.7 and it worked. I neglected to mention I was using Textmate.
To run scripts in Python 3.7 using Textmate, go to Preferences > Variables. If there isn't a variable named TM_PYTHON, create one then paste this in for the value: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3. Else, just change the value. Be sure to check the box next to the variable.

ImportError: No module named skimage.io

I have already installed my scikit-image on my following path:
Requirement already satisfied: scikit-image in /usr/local/lib/python3.6/site-packages (0.14.0)
This is what I can get when I type pip install scikit-image on my mac terminal
However, whenever I run the following:
import skimage.io as io
It keeps returning error as below :
ImportError: No module named skimage.io
What would be the cause of this import failure?
The problem of mine caused from the using python3.
Python3 shares different module path from that of python2.

Categories

Resources