GithubHelp home page GithubHelp logo

Comments (11)

radarhere avatar radarhere commented on May 25, 2024

Hi. You are missing a dependency, as you are building from source. Please try the following

python3 -m pip uninstall Pillow
sudo apt-get install libfreetype6-dev
python3 -m pip install Pillow

For your pypy3 warnings, I would suggest you uninstall Pillow, upgrade pypy3's pip and try again - but it's not relevant if you are ultimately running python3 instead.

from pillow.

nulano avatar nulano commented on May 25, 2024

pypy3 -m pip install --upgrade Pillow
apt install pypy3e Pillow
pip uninstall pillow
then i installed pillow with pip install pillow==10.3.0
python3 -m PIL.report

You are mixing a bunch of different tools here.
Are you trying to use Pillow with pypy3 or /usr/bin/python3?

You should avoid using pip directly because it is not clear which Python version will be used. Instead use pypy3 -m pip or python3 -m pip as radarhere showed above.

Using cached pillow-10.3.0-cp310-cp310-linux_armv7l.whl

What is your CPU architecture? I don't know if anyone has tried installing Pillow with PyPy on arm before. Edit: Actually, arm64 does seem to be covered by our CI, but not 32-bit arm.

from pillow.

SPIN04 avatar SPIN04 commented on May 25, 2024

spino@api:/cam$ python3 -m pip uninstall Pillow
Found existing installation: pillow 10.3.0
Uninstalling pillow-10.3.0:
Would remove:
/home/spino/.local/lib/python3.10/site-packages/PIL/*
/home/spino/.local/lib/python3.10/site-packages/pillow-10.3.0.dist-info/*
Proceed (Y/n)? y
Successfully uninstalled pillow-10.3.0
spino@api:
/cam$ sudo apt-get install libfreetype6-dev
[sudo] password for spino:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libfreetype6-dev is already the newest version (2.11.1+dfsg-1ubuntu0.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
spino@api:/cam$ python3 -m pip install Pillow
Defaulting to user installation because normal site-packages is not writeable
Collecting Pillow
Using cached pillow-10.3.0-cp310-cp310-linux_armv7l.whl
Installing collected packages: Pillow
Successfully installed Pillow-10.3.0
spino@api:
/cam$ python3 main.py
[2024-04-06 15:23:36.207552] [INFO] [main.py] [6] inizio scatto
[2024-04-06 15:23:36.211329] [DEBUG] [main.py] [9] dentro try
[2024-04-06 15:23:48.822373] [DEBUG] [main.py] [11] dopo scatto
[2024-04-06 15:23:48.825461] [INFO] [main.py] [15] fine scatto
[2024-04-06 15:23:48.830057] [INFO] [main.py] [17] inizio set overlay barre
[2024-04-06 15:23:49.165905] [INFO] [main.py] [19] fine set overlay barre
[2024-04-06 15:23:49.169826] [INFO] [main.py] [21] inizio set overlay testo
Error: cannot import name '_imagingft' from 'PIL' (/home/spino/.local/lib/python3.10/site-packages/PIL/init.py)
[2024-04-06 15:23:49.175737] [INFO] [main.py] [23] fine set overlay testo
Tempo di esecuzione: 13.048155307769775 secondi

same error this is running on raspberrry pi2

from pillow.

radarhere avatar radarhere commented on May 25, 2024

I've realised I was wrong - you're not installing from source for python3. I suspect you're using piwheels like #5818.

Could you try this?

python3 -m pip uninstall Pillow
python3 -m pip install Pillow --no-binary :all:

from pillow.

SPIN04 avatar SPIN04 commented on May 25, 2024

same error, i tryed to reinstall the OS and the same error occurred during the installation of pillow WARNING: Generating metadata for package Pillow produced metadata for project name unknown. Fix your #egg=Pillow fragments.
Discarding https://files.pythonhosted.org/packages/f8/3e/32cbd0129a28686621434cbf17bb64bf1458bfb838f1f668262fefce145c/pillow-10.2.0.tar.gz#sha256=e87f0b2c78157e12d7686b27d63c070fd65d994e8ddae6f328e0dcf4a0cd007e (from https://pypi.org/simple/pillow/) (requires-python:>=3.8): Requested unknown from https://files.pythonhosted.org/packages/f8/3e/32cbd0129a28686621434cbf17bb64bf1458bfb838f1f668262fefce145c/pillow-10.2.0.tar.gz#sha256=e87f0b2c78157e12d7686b27d63c070fd65d994e8ddae6f328e0dcf4a0cd007e has inconsistent name: filename has 'pillow', but metadata has 'unknown'
Downloading Pillow-10.1.0.tar.gz (50.8 MB)

the only onw that work is the 10.1.0 but there is always this error Error: cannot import name '_imagingft' from 'PIL' (/home/spino/.local/lib/python3.10/site-packages/PIL/init.py)
now i'm trying to reinstall again everythin

spino@api:~$ sudo apt-get install libfreetype6-dev

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libbrotli-dev libfreetype-dev libpng-dev libpng-tools
Suggested packages:
freetype2-doc
The following NEW packages will be installed:
libbrotli-dev libfreetype-dev libfreetype6-dev libpng-dev libpng-tools
0 upgraded, 5 newly installed, 0 to remove and 57 not upgraded.
Need to get 1029 kB of archives.
After this operation, 3123 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports jammy/main armhf libbrotli-dev armhf 1.0.9-2build6 [320 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports jammy/main armhf libpng-dev armhf 1.6.37-3build5 [176 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main armhf libfreetype-dev armhf 2.11.1+dfsg-1ubuntu0.2 [498 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main armhf libfreetype6-dev armhf 2.11.1+dfsg-1ubuntu0.2 [8292 B]
Get:5 http://ports.ubuntu.com/ubuntu-ports jammy/main armhf libpng-tools armhf 1.6.37-3build5 [26.0 kB]
Fetched 1029 kB in 1s (1983 kB/s)
Selecting previously unselected package libbrotli-dev:armhf.
(Reading database ... 76703 files and directories currently installed.)
Preparing to unpack .../libbrotli-dev_1.0.9-2build6_armhf.deb ...
Unpacking libbrotli-dev:armhf (1.0.9-2build6) ...
Selecting previously unselected package libpng-dev:armhf.
Preparing to unpack .../libpng-dev_1.6.37-3build5_armhf.deb ...
Unpacking libpng-dev:armhf (1.6.37-3build5) ...
Selecting previously unselected package libfreetype-dev:armhf.
Preparing to unpack .../libfreetype-dev_2.11.1+dfsg-1ubuntu0.2_armhf.deb ...
Unpacking libfreetype-dev:armhf (2.11.1+dfsg-1ubuntu0.2) ...
Selecting previously unselected package libfreetype6-dev:armhf.
Preparing to unpack .../libfreetype6-dev_2.11.1+dfsg-1ubuntu0.2_armhf.deb ...
Unpacking libfreetype6-dev:armhf (2.11.1+dfsg-1ubuntu0.2) ...
Selecting previously unselected package libpng-tools.
Preparing to unpack .../libpng-tools_1.6.37-3build5_armhf.deb ...
Unpacking libpng-tools (1.6.37-3build5) ...
Setting up libpng-tools (1.6.37-3build5) ...
Setting up libpng-dev:armhf (1.6.37-3build5) ...
Setting up libbrotli-dev:armhf (1.0.9-2build6) ...
Setting up libfreetype-dev:armhf (2.11.1+dfsg-1ubuntu0.2) ...
Setting up libfreetype6-dev:armhf (2.11.1+dfsg-1ubuntu0.2) ...
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...
Scanning candidates...
Scanning processor microcode...
Scanning linux images...

Running kernel seems to be up-to-date.

Failed to check for processor microcode upgrades.

Restarting services...
Service restarts being deferred:
/etc/needrestart/restart.d/dbus.service
systemctl restart networkd-dispatcher.service
systemctl restart unattended-upgrades.service

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
spino@api:~$ pip install pillow==10.3.0
Defaulting to user installation because normal site-packages is not writeable
Collecting pillow==10.3.0
Downloading pillow-10.3.0.tar.gz (46.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.6/46.6 MB 1.1 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
WARNING: Generating metadata for package pillow produced metadata for project name unknown. Fix your #egg=pillow fragments.
Discarding https://files.pythonhosted.org/packages/ef/43/c50c17c5f7d438e836c169e343695534c38c77f60e7c90389bd77981bc21/pillow-10.3.0.tar.gz#sha256=9d2455fbf44c914840c793e89aa82d0e1763a14253a000743719ae5946814b2d (from https://pypi.org/simple/pillow/) (requires-python:>=3.8): Requested unknown from https://files.pythonhosted.org/packages/ef/43/c50c17c5f7d438e836c169e343695534c38c77f60e7c90389bd77981bc21/pillow-10.3.0.tar.gz#sha256=9d2455fbf44c914840c793e89aa82d0e1763a14253a000743719ae5946814b2d has inconsistent name: filename has 'pillow', but metadata has 'unknown'
ERROR: Could not find a version that satisfies the requirement pillow==10.3.0 (from versions: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.7.8, 2.0.0, 2.1.0, 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.3.2, 2.4.0, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.8.0, 2.8.1, 2.8.2, 2.9.0, 3.0.0, 3.1.0rc1, 3.1.0, 3.1.1, 3.1.2, 3.2.0, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.4.0, 3.4.1, 3.4.2, 4.0.0, 4.1.0, 4.1.1, 4.2.0, 4.2.1, 4.3.0, 5.0.0, 5.1.0, 5.2.0, 5.3.0, 5.4.0, 5.4.1, 6.0.0, 6.1.0, 6.2.0, 6.2.1, 6.2.2, 7.0.0, 7.1.0, 7.1.1, 7.1.2, 7.2.0, 8.0.0, 8.0.1, 8.1.0, 8.1.1, 8.1.2, 8.2.0, 8.3.0, 8.3.1, 8.3.2, 8.4.0, 9.0.0, 9.0.1, 9.1.0, 9.1.1, 9.2.0, 9.3.0, 9.4.0, 9.5.0, 10.0.0, 10.0.1, 10.1.0, 10.2.0, 10.3.0)
ERROR: No matching distribution found for pillow==10.3.0

spino@api:~$ python3 -m pip install Pillow --no-binary :all:
Defaulting to user installation because normal site-packages is not writeable
Collecting Pillow
Using cached pillow-10.3.0.tar.gz (46.6 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
WARNING: Generating metadata for package Pillow produced metadata for project name unknown. Fix your #egg=Pillow fragments.
Discarding https://files.pythonhosted.org/packages/ef/43/c50c17c5f7d438e836c169e343695534c38c77f60e7c90389bd77981bc21/pillow-10.3.0.tar.gz#sha256=9d2455fbf44c914840c793e89aa82d0e1763a14253a000743719ae5946814b2d (from https://pypi.org/simple/pillow/) (requires-python:>=3.8): Requested unknown from https://files.pythonhosted.org/packages/ef/43/c50c17c5f7d438e836c169e343695534c38c77f60e7c90389bd77981bc21/pillow-10.3.0.tar.gz#sha256=9d2455fbf44c914840c793e89aa82d0e1763a14253a000743719ae5946814b2d has inconsistent name: filename has 'pillow', but metadata has 'unknown'
Downloading pillow-10.2.0.tar.gz (46.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.2/46.2 MB 1.3 MB/s eta 0:00:00
^CERROR: Operation cancelled by user

from pillow.

radarhere avatar radarhere commented on May 25, 2024

Could you try upgrading pip?

python3 -m pip install --upgrade pip
python3 -m pip uninstall Pillow
python3 -m pip install Pillow --no-binary :all:

Also, why do you keep cancelling the operation?

from pillow.

SPIN04 avatar SPIN04 commented on May 25, 2024

i have tryed something and instaled a bounch of package, now is working but i have a different error when i run the code
all the file are in the cam folder and has 777 permission

spino@api:~/cam$ python3 main.py
[2024-04-07 14:54:57.371576] [INFO] [main.py] [6] inizio scatto
[2024-04-07 14:54:57.380451] [DEBUG] [main.py] [9] dentro try
[2024-04-07 14:55:10.075407] [DEBUG] [main.py] [12] dopo scatto
[2024-04-07 14:55:10.077701] [INFO] [main.py] [16] fine scatto
[2024-04-07 14:55:10.081333] [INFO] [main.py] [18] inizio set overlay barre
[2024-04-07 14:55:10.430679] [INFO] [main.py] [20] fine set overlay barre
[2024-04-07 14:55:10.434453] [INFO] [main.py] [22] inizio set overlay testo
Error: cannot open resource<-------------------------------------------------------------------------------------
[2024-04-07 14:55:10.447879] [INFO] [main.py] [24] fine set overlay testo
Tempo di esecuzione: 13.152425765991211 secondi

from pillow.

radarhere avatar radarhere commented on May 25, 2024

I expect that is trying to tell you that the path to the font is incorrect.

from pillow.

SPIN04 avatar SPIN04 commented on May 25, 2024

fixed, now it is writing, no error but i wonder if there is a way to get the height that the text will cover
getlength but i can't find in the documentation the height

from pillow.

nulano avatar nulano commented on May 25, 2024

See draw.textbbox

from pillow.

SPIN04 avatar SPIN04 commented on May 25, 2024

ok now it works fine

from pillow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.