How to install pillow for python3 Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
User avatar
MichaIng
Legend
Posts: 1510
Joined: Sat Nov 18, 2017 5:21 pm

Re: How to install pillow for python3

Post by MichaIng » Mon Jun 03, 2019 4:10 pm

@dietpiOK
Try to update/install the mentioned modules first: pip3 install setuptools tokenize

dietpiOK
Posts: 72
Joined: Thu Mar 16, 2017 8:33 am

Re: How to install pillow for python3

Post by dietpiOK » Tue Jun 04, 2019 10:49 am

pip3 install setuptools worked perfectly, but:

[email protected]:~# pip3 install tokenize
Collecting tokenize
Could not find a version that satisfies the requirement tokenize (from versions: )
No matching distribution found for tokenize


What does that mean?

User avatar
MichaIng
Legend
Posts: 1510
Joined: Sat Nov 18, 2017 5:21 pm

Re: How to install pillow for python3

Post by MichaIng » Sun Jun 09, 2019 8:14 pm

@dietpiOK
Ah the modules is named "tokenizer": pip3 install tokenizer
You might also need to install apt install python3-dev which is somehow missing when dietpi-software installs python3-pip.

dietpiOK
Posts: 72
Joined: Thu Mar 16, 2017 8:33 am

Re: How to install pillow for python3

Post by dietpiOK » Mon Jun 10, 2019 3:03 pm

Thanks, MichIng, I just did not see that typo.

Unfortunately installing pillow still does not work:

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-_8lazntv/pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-yqukurd1-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-_8lazntv/pillow/

[email protected]:~# pip3 install tokenizer
Requirement already satisfied: tokenizer in /usr/local/lib/python3.5/dist-packages

User avatar
MichaIng
Legend
Posts: 1510
Joined: Sat Nov 18, 2017 5:21 pm

Re: How to install pillow for python3

Post by MichaIng » Thu Jun 13, 2019 4:20 pm

@dietpiOK
You installed apt install python3-dev?

dietpiOK
Posts: 72
Joined: Thu Mar 16, 2017 8:33 am

Re: How to install pillow for python3

Post by dietpiOK » Thu Jun 13, 2019 6:32 pm

Yes, it is installed.

User avatar
MichaIng
Legend
Posts: 1510
Joined: Sat Nov 18, 2017 5:21 pm

Re: How to install pillow for python3

Post by MichaIng » Fri Jun 14, 2019 1:13 am

@dietpiOK
Can you please paste the full output of pip3 install pillow? Perhaps some previous lines give a hint what is missing, e.g. some other dev or library package.

E.g.: https://stackoverflow.com/questions/391 ... python-3-6
- zlib required as long as you do not exclude it via command option.
- The last error exactly matches yours (besides Windows style file paths) but the lines before clearly state that zlib is expected.

Also see: https://stackoverflow.com/questions/346 ... e-in-linux
Besides checking for and in case install missing libs/-dev packages, the suggestion is to update pip via pip :):

Code: Select all

pip3 install -U pip
hash -r # Required to reload the $PATH variable with the new pip3 binary

dietpiOK
Posts: 72
Joined: Thu Mar 16, 2017 8:33 am

Re: How to install pillow for python3

Post by dietpiOK » Fri Jun 14, 2019 8:10 am

Issue is solved!

Thanks Dan, for your support.
I had tp update pip3... Now everything works and pillow is running.

User avatar
MichaIng
Legend
Posts: 1510
Joined: Sat Nov 18, 2017 5:21 pm

Re: How to install pillow for python3

Post by MichaIng » Fri Jun 14, 2019 3:03 pm

Great that it worked. Made me play around a bid with pip/pip3 and it works quite handy in combination with APT packages. If you install modules via pip, the ones from the APT packages are even removed, so only the new version will stay in place, thus no data overhead :+1:. However of course bad if some own python project requires a specific version, however easy to achieve with pip as well, much more flexible than APT.

Post Reply