4

Not sure what is causing this...

I am running Python 3.4.3 using the "Pillow-3.3.0.win32-py34.exe" installation file.

Upon import Image with

from PIL import Image

I try to set "a.jpg" as my image using

img = Image.open("a.jpg")

However I get this error,

>>> img = Image.open("a.jpg")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python34\lib\site-packages\PIL\Image.py", line 2289, in open
    preinit()
  File "C:\Python34\lib\site-packages\PIL\Image.py", line 365, in preinit
    from PIL import JpegImagePlugin
  File "C:\Python34\lib\site-packages\PIL\JpegImagePlugin.py", line 40, in <modu
le>
    from PIL import Image, ImageFile, TiffImagePlugin, _binary
  File "C:\Python34\lib\site-packages\PIL\TiffImagePlugin.py", line 50, in <modu
le>
    from fractions import Fraction
  File "C:\Python34\lib\fractions.py", line 6, in <module>
    from decimal import Decimal
  File "C:\Python34\lib\decimal.py", line 3855, in <module>
    _numbers.Number.register(Decimal)
AttributeError: 'module' object has no attribute 'Number'

Might not be related to Pillow, but would still really appreciate help!

1 Answer 1

22

Is there a file called numbers.py in the current working directory?

That could be the reason of the problem, because it'd prevent the import of the standard library module numbers.

(Suggestion from here.)

Sign up to request clarification or add additional context in comments.

1 Comment

Yes when you are learning you might create file named numbers.py

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.