PIL ImportError with Image - python

I am having trouble with PIL import Image. I have Pillow installed. But when I try something like from PIL import Image it gives following error.
>>> from PIL import Image
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/7.1/lib/python2.7/site-packages/Pillow-2.5.2-py2.7-macosx-10.5-i386.egg/PIL/Image.py", line 61, in <module>
from PIL import _imaging as core
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/7.1/lib/python2.7/site-packages/Pillow-2.5.2-py2.7-macosx-10.5-i386.egg/PIL/_imaging.so, 2): Symbol not found: _TIFFClientOpen
Referenced from: /Library/Frameworks/Python.framework/Versions/7.1/lib/python2.7/site-packages/Pillow-2.5.2-py2.7-macosx-10.5-i386.egg/PIL/_imaging.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/7.1/lib/python2.7/site-packages/Pillow-2.5.2-py2.7-macosx-10.5-i386.egg/PIL/_imaging.so

Related

I am trying to load in an image from the same folder as the one my python script is in

C:\Users\Developer\AppData\Local\Programs\Python\Python39\python.exe D:\PHD\PycharmProjects\face_Detect_1\main.py
Traceback (most recent call last):
File "D:\PHD\PycharmProjects\face_Detect_1\main.py", line 5, in
from PIL import Image, ImageTk
File "C:\Users\Developer\AppData\Roaming\Python\Python39\site-packages\PIL\Image.py", line 103, in
from . import _imaging as core
ImportError: DLL load failed while importing _imaging: The specified procedure could not be found.
please help me
Thank you in advance for the help!

ImportError: cannot import name 'imread' from 'scipy.misc'

When trying to load an image file with scipy.misc.imread(), I receive this unexpected error:
Traceback (most recent call last):
File "/home/ghita/PycharmProjects/image_processing/venv/test1.py", line 2, in <module>
from scipy.misc import imread, imsave
ImportError: cannot import name 'imread' from 'scipy.misc' (/home/ghita/PycharmProjects/image_processing/venv/lib/python3.8/site-packages/scipy/misc/__init__.py)
Why does this fail?
It looks like imread has been removed from scipy.misc. They now recommend that you use imread from the imageio package.

Python to read text from picture giving some import package errors

Unable to read text from a picture using PIL and pytesseract
import PIL
from PIL import Image
import pytesseract
im = PIL.Image.open('C:\\Users\\Edgar.Lizarraga\\Desktop\\Kaizen-Continuous-Improvement-Model.png')
x = pytesseract.image_to_string(im)
print(x)
giving me the following message:
Traceback (most recent call last):
File "C:\Users\Edgar.Lizarraga\AppData\Local\Continuum\anaconda33\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
from . import multiarray
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/Edgar.Lizarraga/PycharmProjects/Pic2/pic2.py", line 3, in <module>
import pytesseract
File "C:\Users\Edgar.Lizarraga\AppData\Local\Continuum\anaconda33\lib\site-packages\pytesseract\__init__.py", line 1, in <module>
from .pytesseract import (
File "C:\Users\Edgar.Lizarraga\AppData\Local\Continuum\anaconda33\lib\site-packages\pytesseract\pytesseract.py", line 27, in <module>
from numpy import ndarray
File "C:\Users\Edgar.Lizarraga\AppData\Local\Continuum\anaconda33\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import add_newdocs
File "C:\Users\Edgar.Lizarraga\AppData\Local\Continuum\anaconda33\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Users\Edgar.Lizarraga\AppData\Local\Continuum\anaconda33\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Users\Edgar.Lizarraga\AppData\Local\Continuum\anaconda33\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Users\Edgar.Lizarraga\AppData\Local\Continuum\anaconda33\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: DLL load failed: The specified module could not be found.
I'm not sure if this could cause the issue but you should't need to import both PIL and PIL.Image.
Would comment this but I don't have 50 rep.

Module Import Error Img

I am trying to import the image module from pillow 5.1.0. Using python 3.6.5.
I typed in the following command
from PIL import image.
Upon doing this I get the following error.
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
from PIL import image
ImportError: cannot import name 'image'
Try from PIL import Image (note the capital 'I' in Image).

scikit-image - Missing DLL

I have installed scikit-image from a binary but when I run this command:
from skimage.measure import structural_similarity
I get this error:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
from skimage.measure import structural_similarity as ssim
File "C:\Python27\lib\site-packages\skimage\measure\__init__.py", line 4, in <module>
from ._regionprops import regionprops, perimeter
File "C:\Python27\lib\site-packages\skimage\measure\_regionprops.py", line 8, in <module>
from . import _moments
File "C:\Python27\lib\site-packages\skimage\measure\_moments.py", line 3, in <module>
from . import _moments_cy
ImportError: DLL load failed: The specified module could not be found.
There is a file named _moments_cy.pyd in that directory, not sure if that's what it's asking for.
from skimage.metrics import structural_similarity as ssim
The module is now moved to metrics instead of measure.

Categories

Resources