ImportError: No module named skimage.io - python

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.

Related

Numpy is not working on pypy3.8: ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

I'm trying to use pypy3.8 to improve the speed of my code.
However, numpy module is not working.
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' was occurred
I copied numpy from the python 3.9.3 library folder and pasted it into the pypy3 folder.
Also, I checked it was installed by pypy3 -m pip install numpy and the result was Requirement already satisfied: numpy in c:\users\username\desktop\pypy3\lib\site-packages (1.21.4)
What should I do to resolve this error??
Should I use python 3.8 to solve this problem?

No module named 'PIL' althought the installing command

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...

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.

Unable to import PIL into project

The PIL module should be installed because when I run the pip install pillow I get this message: Requirement already satisfied: pillow in [my installation route]. But, when I try to import this into a file, I get this error:
ModuleNotFoundError: No module named 'Pillow'
What am I doing wrong?
this has worked for me if your using vscode try install by typing py -m pip install pillow
from PIL import ImageTk,Image
Pillow is a fork of PIL, and the import is carried over.
import PIL
Should do the trick. The documentation has additional details:
https://pillow.readthedocs.io/en/stable/installation.html

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.

Categories

Resources