-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: The _imagingft C module is not installed (Raspberry Pi 4 Buster) #5818
Comments
I presume you're using pip to install Pillow? As to why there is a difference, my first suspicion is that we are no longer providing binary wheels for your system - but let's check. Could you show the output of the pip command when you install Pillow 7.2? As to fixing your problem, I recommend |
What operating system are you running, specifically?
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"NAME="Raspbian GNU/Linux"VERSION_ID="10"VERSION="10 (buster)"VERSION_CODENAME=busterID=raspbianID_LIKE=debianHOME_URL="http://www.raspbian.org/"SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
|
==> This is how I install the venv and modules./home/pi/.pyenv/versions/3.9.7/bin/python -m venv ./venvsource ./venv/bin/activatepython3 -m pip install --upgrade pippip3 install adafruit-circuitpython-ssd1306pip3 install Pillow==7.2.0pip3 listpip3 list
python ssd1306_pillow_text.py
==> Message printed for the Pillow installationit_CircuitPython_projects/ssd1306_oled_display2_pipcheck $ pip3 install Pillow==7.2.0Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simpleCollecting Pillow==7.2.0 Using cached https://www.piwheels.org/simple/pillow/Pillow-7.2.0-cp39-cp39-linux_armv7l.whl (1.1 MB)Installing collected packages: PillowSuccessfully installed Pillow-7.2.0(venv) ***@***.***:~/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_p
==> All the modules installed.rojects/ssd1306_oled_display2_pipcheck $ pip3 listPackage Version-------------------------------- -------Adafruit-Blinka 6.15.0adafruit-circuitpython-busdevice 5.1.0adafruit-circuitpython-framebuf 1.4.7adafruit-circuitpython-ssd1306 2.12.2Adafruit-PlatformDetect 3.17.1Adafruit-PureIO 1.1.9Pillow 7.2.0pip 21.3.1pyftdi 0.53.3pyserial 3.5pyusb 1.2.1RPi.GPIO 0.7.0rpi-ws281x 4.3.1setuptools 57.4.0sysv-ipc 1.1.0
==> I recommend apt-get install libfreetype6-dev
I found this suggestion from another post. I tried it. It does not help. Is it because I use venv? I can try it again.
|
== > Install libfreetype6-devoled_display2_pilv84 $ sudo apt-get install libfreetype6-devReading package lists... DoneBuilding dependency tree Reading state information... Donelibfreetype6-dev is already the newest version (2.9.1-3+deb10u2).The following packages were automatically installed and are no longer required: gconf-service gconf2-common libexiv2-14 libgconf-2-4 libgfortran3 libgmime-2.6-0 libncurses5 libssl1.0.2 lxplug-volume python-colorzero uuid-devUse 'sudo apt autoremove' to remove them.0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
==> Install Pillow Version 8.4(venv) ***@***.***:~/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84 $ pip3 install PillowLooking in indexes: https://pypi.org/simple, https://www.piwheels.org/simpleCollecting Pillow Using cached https://www.piwheels.org/simple/pillow/Pillow-8.4.0-cp39-cp39-linux_armv7l.whl (1.1 MB)Installing collected packages: PillowSuccessfully installed Pillow-8.4.0(venv)
==> PIP3 ***@***.***:~/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84 $ pip3 listPackage Version-------------------------------- -------Adafruit-Blinka 6.15.0adafruit-circuitpython-busdevice 5.1.0adafruit-circuitpython-framebuf 1.4.7adafruit-circuitpython-ssd1306 2.12.2Adafruit-PlatformDetect 3.17.1Adafruit-PureIO 1.1.9Pillow 8.4.0pip 21.3.1pyftdi 0.53.3pyserial 3.5pyusb 1.2.1RPi.GPIO 0.7.0rpi-ws281x 4.3.1setuptools 57.4.0sysv-ipc 1.1.0
==> Same error!(venv) ***@***.***:~/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84 $ python ssd1306_pillow_text.pyTraceback (most recent call last): File "/home/pi/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84/ssd1306_pillow_text.py", line 57, in <module> font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 28) File "/home/pi/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84/venv/lib/python3.9/site-packages/PIL/ImageFont.py", line 855, in truetype return freetype(font) File "/home/pi/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84/venv/lib/python3.9/site-packages/PIL/ImageFont.py", line 852, in freetype return FreeTypeFont(font, size, index, encoding, layout_engine) File "/home/pi/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84/venv/lib/python3.9/site-packages/PIL/ImageFont.py", line 187, in __init__ if core.HAVE_RAQM: File "/home/pi/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84/venv/lib/python3.9/site-packages/PIL/ImageFont.py", line 44, in __getattr__ raise ImportError("The _imagingft C module is not installed")ImportError: The _imagingft C module is not installed(venv) ***@***.***:~/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84 $
Best regards,Michael
|
So for 7.2.0 you downloaded https://www.piwheels.org/simple/pillow/Pillow-7.2.0-cp39-cp39-linux_armv7l.whl And there is also https://www.piwheels.org/simple/pillow/Pillow-8.4.0-cp39-cp39-linux_armv7l.whl, so my initial theory was not correct. Try building from source instead - |
The install failed with errors. First I uninstalled Pillow and then reinstall with your command.
This is the output.
(venv) ***@***.***:~/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84 $ pip uninstall PillowFound existing installation: Pillow 8.4.0Uninstalling Pillow-8.4.0: Would remove: /home/pi/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84/venv/lib/python3.9/site-packages/PIL/* /home/pi/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84/venv/lib/python3.9/site-packages/Pillow-8.4.0.dist-info/*Proceed (Y/n)? Y Successfully uninstalled Pillow-8.4.0(venv) ***@***.***:~/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84 $ pip3 listPackage Version-------------------------------- -------Adafruit-Blinka 6.15.0adafruit-circuitpython-busdevice 5.1.0adafruit-circuitpython-framebuf 1.4.7adafruit-circuitpython-ssd1306 2.12.2Adafruit-PlatformDetect 3.17.1Adafruit-PureIO 1.1.9pip 21.3.1pyftdi 0.53.3pyserial 3.5pyusb 1.2.1RPi.GPIO 0.7.0rpi-ws281x 4.3.1setuptools 57.4.0sysv-ipc 1.1.0(venv) ***@***.***:~/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84 $ pip3 install Pillow --no-binary :all:Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simpleCollecting Pillow Downloading Pillow-8.4.0.tar.gz (49.4 MB) |████████████████████████████████| 49.4 MB 1.4 kB/s Preparing metadata (setup.py) ... doneSkipping wheel build for Pillow, due to binaries being disabled for it.Installing collected packages: Pillow Running setup.py install for Pillow ... error ERROR: Command errored out with exit status 1: command: /home/pi/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84/venv/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qo9mttm7/pillow_6da0cdcf11de4c99a9e4ce659bdf61cd/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qo9mttm7/pillow_6da0cdcf11de4c99a9e4ce659bdf61cd/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-bohnwg9x/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84/venv/include/site/python3.9/Pillow cwd: /tmp/pip-install-qo9mttm7/pillow_6da0cdcf11de4c99a9e4ce659bdf61cd/ Complete output (176 lines): running install running build running build_py creating build creating build/lib.linux-armv7l-3.9 creating build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageDraw2.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/__init__.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageTransform.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageOps.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/PixarImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImtImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageDraw.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/JpegPresets.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/FontFile.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/GifImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageMode.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/GimpPaletteFile.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageQt.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageGrab.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/EpsImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageTk.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/GimpGradientFile.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/TgaImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageFont.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/Image.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageStat.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageMath.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/MspImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/PdfImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/WalImageFile.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/WebPImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/FliImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/PalmImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageEnhance.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/__main__.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/PsdImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/FpxImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/TiffTags.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/GdImageFile.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/PaletteFile.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ContainerIO.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageSequence.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/PcdImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/_util.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/SunImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/TarIO.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/PngImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/FtexImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageWin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/_version.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/PyAccess.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/PcfFontFile.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/MpegImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/PdfParser.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/PpmImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/IptcImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/MicImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/SgiImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/_binary.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/CurImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/_tkinter_finder.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/DdsImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageShow.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/features.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImagePath.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/BdfFontFile.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/IcoImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImagePalette.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageChops.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/BmpImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/WmfImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/TiffImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/PSDraw.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/PcxImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/GbrImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/BlpImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageMorph.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/XpmImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageColor.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/XbmImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ExifTags.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageFilter.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageCms.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/JpegImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/MpoImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/ImageFile.py -> build/lib.linux-armv7l-3.9/PIL copying src/PIL/DcxImagePlugin.py -> build/lib.linux-armv7l-3.9/PIL running egg_info writing src/Pillow.egg-info/PKG-INFO writing dependency_links to src/Pillow.egg-info/dependency_links.txt writing top-level names to src/Pillow.egg-info/top_level.txt reading manifest file 'src/Pillow.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching '*.c' warning: no files found matching '*.h' warning: no files found matching '*.sh' warning: no previously-included files found matching '.appveyor.yml' warning: no previously-included files found matching '.clang-format' warning: no previously-included files found matching '.coveragerc' warning: no previously-included files found matching '.editorconfig' warning: no previously-included files found matching '.readthedocs.yml' warning: no previously-included files found matching 'codecov.yml' warning: no previously-included files matching '.git*' found anywhere in distribution warning: no previously-included files matching '*.pyc' found anywhere in distribution warning: no previously-included files matching '*.so' found anywhere in distribution no previously-included directories found matching '.ci' adding license file 'LICENSE' writing manifest file 'src/Pillow.egg-info/SOURCES.txt' running build_ext The headers or library files could not be found for jpeg, a required dependency when compiling Pillow from source. Please see the install instructions at: https://pillow.readthedocs.io/en/latest/installation.html Traceback (most recent call last): File "/tmp/pip-install-qo9mttm7/pillow_6da0cdcf11de4c99a9e4ce659bdf61cd/setup.py", line 978, in <module> setup( File "/home/pi/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84/venv/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup return distutils.core.setup(**attrs) File "/home/pi/.pyenv/versions/3.9.7/lib/python3.9/distutils/core.py", line 148, in setup dist.run_commands() File "/home/pi/.pyenv/versions/3.9.7/lib/python3.9/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/home/pi/.pyenv/versions/3.9.7/lib/python3.9/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/pi/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84/venv/lib/python3.9/site-packages/setuptools/command/install.py", line 61, in run return orig.install.run(self) File "/home/pi/.pyenv/versions/3.9.7/lib/python3.9/distutils/command/install.py", line 546, in run self.run_command('build') File "/home/pi/.pyenv/versions/3.9.7/lib/python3.9/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/pi/.pyenv/versions/3.9.7/lib/python3.9/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/pi/.pyenv/versions/3.9.7/lib/python3.9/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/home/pi/.pyenv/versions/3.9.7/lib/python3.9/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/pi/.pyenv/versions/3.9.7/lib/python3.9/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/pi/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84/venv/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 79, in run _build_ext.run(self) File "/home/pi/.pyenv/versions/3.9.7/lib/python3.9/distutils/command/build_ext.py", line 340, in run self.build_extensions() File "/tmp/pip-install-qo9mttm7/pillow_6da0cdcf11de4c99a9e4ce659bdf61cd/setup.py", line 790, in build_extensions raise RequiredDependencyException(f) __main__.RequiredDependencyException: jpeg During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-qo9mttm7/pillow_6da0cdcf11de4c99a9e4ce659bdf61cd/setup.py", line 1037, in <module> raise RequiredDependencyException(msg) __main__.RequiredDependencyException: The headers or library files could not be found for jpeg, a required dependency when compiling Pillow from source. Please see the install instructions at: https://pillow.readthedocs.io/en/latest/installation.html ----------------------------------------ERROR: Command errored out with exit status 1: /home/pi/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84/venv/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qo9mttm7/pillow_6da0cdcf11de4c99a9e4ce659bdf61cd/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qo9mttm7/pillow_6da0cdcf11de4c99a9e4ce659bdf61cd/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-bohnwg9x/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84/venv/include/site/python3.9/Pillow Check the logs for full command output.(venv) ***@***.***:~/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84 $
On Sunday, November 7, 2021, 07:28:44 PM PST, Andrew Murray ***@***.***> wrote:
So for 7.2.0 you downloaded https://www.piwheels.org/simple/pillow/Pillow-7.2.0-cp39-cp39-linux_armv7l.whl
And there is also https://www.piwheels.org/simple/pillow/Pillow-8.4.0-cp39-cp39-linux_armv7l.whl, so my initial theory was not correct.
Try building from source instead - pip3 install Pillow --no-binary :all:
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
|
The new way solves the problem! Thank you so much for your help!!!
So, the problem is related to the library that handles the JPEG files, not the library that provides the FreeType 2 font engine.
Here are the steps taken to install all the python modules including Pillow and to run the Pillow text example.
sudo apt-get install libjpeg62-turbo-dev
/home/pi/.pyenv/versions/3.9.7/bin/python -m venv ./venv
source ./venv/bin/activatepython3 -m pip install --upgrade pip
pip3 install adafruit-circuitpython-ssd1306pip3 install Pillow --no-binary :all:
pip3 listppython ssd1306_pillow_text.py
=== Taken from the terminal screen =======
uitPython_projects/ssd1306_oled_display2_pilv84 $ sudo apt-get install libjpeg62-turbo-devReading package lists... DoneBuilding dependency tree Reading state information... DoneThe following packages were automatically installed and are no longer required: gconf-service gconf2-common libexiv2-14 libgconf-2-4 libgfortran3 libgmime-2.6-0 libncurses5 libssl1.0.2 lxplug-volume python-colorzero uuid-devUse 'sudo apt autoremove' to remove them.The following NEW packages will be installed: libjpeg62-turbo-dev0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.Need to get 181 kB of archives.After this operation, 475 kB of additional disk space will be used.Get:1 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf libjpeg62-turbo-dev armhf 1:1.5.2-2+deb10u1 [181 kB]Fetched 181 kB in 1s (173 kB/s) Selecting previously unselected package libjpeg62-turbo-dev:armhf.(Reading database ... 172882 files and directories currently installed.)Preparing to unpack .../libjpeg62-turbo-dev_1%3a1.5.2-2+deb10u1_armhf.deb ...Unpacking libjpeg62-turbo-dev:armhf (1:1.5.2-2+deb10u1) ...Setting up libjpeg62-turbo-dev:armhf (1:1.5.2-2+deb10u1) ...***@***.***:~/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_C..
==>pip3 install Pillow --no-binary :all:(venv) ***@***.***:~/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84 $pip3 install Pillow --no-binary :all:Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simpleCollecting Pillow Using cached Pillow-8.4.0.tar.gz (49.4 MB) Preparing metadata (setup.py) ... doneSkipping wheel build for Pillow, due to binaries being disabled for it.Installing collected packages: Pillow Running setup.py install for Pillow ... doneSuccessfully installed Pillow-8.4.0
==>pip3 list(venv) ***@***.***:~/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84 $pip3 listPackage Version-------------------------------- -------Adafruit-Blinka 6.15.0adafruit-circuitpython-busdevice 5.1.0adafruit-circuitpython-framebuf 1.4.7adafruit-circuitpython-ssd1306 2.12.2Adafruit-PlatformDetect 3.17.1Adafruit-PureIO 1.1.9Pillow 8.4.0pip 21.3.1pyftdi 0.53.3pyserial 3.5pyusb 1.2.1RPi.GPIO 0.7.0rpi-ws281x 4.3.1setuptools 57.4.0sysv-ipc 1.1.0
==> Run the example code (no error. "Hello" is displayed on the OLED screen."(venv) ***@***.***:~/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84 $ python ssd1306_pillow_text.py(venv) ***@***.***:~/Documents/projects/python_examples/new_MyPiHat_v2/Adafruit_CircuitPython_projects/ssd1306_oled_display2_pilv84 $
On Sunday, November 7, 2021, 08:28:25 PM PST, Andrew Murray ***@***.***> wrote:
apt-get install libjpeg62-turbo-dev and then try pip3 install Pillow --no-binary :all: again.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
/home/pi/.pyenv/versions/3.9.7/bin/python -m venv ./venv I want to comment on this line. I can't use "python3 -m venv ./venv" because pyenv is not able to redirect the 3.9.7 python path (pyenv local 3.9.7) with Raspbian Pi Buster OS. I am still waiting for the pyenv team to solve this issue. I just want to use a higher version of Python to run Pillow. The default Python3 is 3.7.4 with Raspian Pi Buster OS. I want to say this so that others may be puzzled why I need to do it this way. |
Ok, unless I misunderstand then, this is resolved. |
Yes. The issue is resolved now. You can close it. Thank you. |
I want to report this error. It has something to do with the latest version 8.4 of Pillow module. If I installed version 7.2, I would not get this error and the example (ssd1306_pillow_text.py) will work just fine with my OLED display.
Below is the complete track message. Again, it only happens when I run the example with version 8.4.
The text was updated successfully, but these errors were encountered: