AttributeError: module 'PIL.Image' has no attribute 'new'
See original GitHub issueType of Raspberry Pi
Raspberry Pi Zero WH
Linux Kernel version
Linux raspberrypi 5.10.17+ #1414 Fri Apr 30 13:16:27 BST 2021 armv6l GNU/Linux
Expected behaviour
I’m expecting Python to run the code without errors. I inspected 10s of issues but didn’t find any solution. Before getting that error I was getting something like: No module named luma.led.matrix found or same for luma.core.
Actual behaviour
pi@raspberrypi:~/luma.led_matrix $ sudo python3 -m pip install luma.core luma.led_matrix
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting luma.core
Using cached https://www.piwheels.org/simple/luma-core/luma.core-2.3.1-py2.py3-none-any.whl (71 kB)
Collecting luma.led_matrix
Using cached https://www.piwheels.org/simple/luma-led-matrix/luma.led_matrix-1.5.0-py2.py3-none-any.whl (19 kB)
Requirement already satisfied: cbor2 in /usr/local/lib/python3.7/dist-packages (from luma.core) (5.4.2)
Requirement already satisfied: pillow>=4.0.0 in /usr/local/lib/python3.7/dist-packages (from luma.core) (8.4.0)
Requirement already satisfied: spidev in /usr/lib/python3/dist-packages (from luma.core) (3.4)
Requirement already satisfied: RPI.GPIO in /usr/lib/python3/dist-packages (from luma.core) (0.7.0)
Requirement already satisfied: pyftdi in /usr/local/lib/python3.7/dist-packages (from luma.core) (0.53.3)
Requirement already satisfied: smbus2 in /usr/local/lib/python3.7/dist-packages (from luma.core) (0.4.1)
Requirement already satisfied: deprecated in /usr/local/lib/python3.7/dist-packages (from luma.core) (1.2.13)
Installing collected packages: luma.core, luma.led-matrix
Successfully installed luma.core-2.3.1 luma.led-matrix-1.5.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
pi@raspberrypi:~/luma.led_matrix $ sudo python3 examples/matrix_demo.py
Traceback (most recent call last):
File "examples/matrix_demo.py", line 122, in <module>
demo(args.cascaded, args.block_orientation, args.rotate, args.reverse_order)
File "examples/matrix_demo.py", line 22, in demo
rotate=rotate or 0, blocks_arranged_in_reverse_order=inreverse)
File "/usr/local/lib/python3.7/dist-packages/luma/led_matrix/device.py", line 89, in __init__
self.clear()
File "/usr/local/lib/python3.7/dist-packages/luma/core/mixin.py", line 46, in clear
self.display(Image.new(self.mode, self.size))
AttributeError: module 'PIL.Image' has no attribute 'new'
Issue Analytics
- State:
- Created 2 years ago
- Comments:10
Top Results From Across the Web
Python PIL has no attribute 'Image' - Stack Overflow
I'm using python2.6 and got a problem this morning. It said 'module' has no attribute ...
Read more >Dealing with 'PIL.Image' has no attribute 'register_extensions'
AttributeError : module 'PIL.Image' has no attribute 'register_extensions'. This error occurs if we are using older version of pillow.
Read more >module 'PIL.Image' has no attribute 'VERSION' python2 pip ...
Probably you got new PIL version which is not backward compatible. Either you uninstall it using pip then cinnamon-settings will use the ...
Read more >PIL has no attribute: Image : r/learnpython - Reddit
Hey, everyone! I'm trying to execute this notebook , but I came across an attribute error: PIL has no attribute Image.
Read more >module pil has no attribute image - You.com | The AI Search ...
Given an open('photo', 'rb') as a second argument, it raises an AttributeError "module 'PIL' has no attribute Image". Which means that Python does...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found the problem. The integrated was connected incorrectly.
nice!
Can you be a little more specific? Maybe it helps others googling similar problems.