How to install pillow for python3 Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
dietpiOK
Posts: 72
Joined: Thu Mar 16, 2017 8:33 am

How to install pillow for python3

Post by dietpiOK » Fri May 24, 2019 4:24 pm

Hi!

I used the PIL library with python 2.x for a long time.
Now I am shifting all my python code to python3. Unfortunately I am not able to get the pillow package installed on my dietpi-machine.

Did anyone suceed on that?

When running "pip install pillow -v --no-cache-dir" I get the following error messages:

ERROR: Failed building wheel for pillow

and later:

ERROR: Command "/usr/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-ZNfXJ2/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-record-PY96iM/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-ZNfXJ2/pillow/


Any help appreciated.

Best regards,
Olaf

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 May 26, 2019 1:11 am

@dietpiOK
Try to use the php3 command and install the setuptools and tokenize modules first:

Code: Select all

pip3 install setuptools
pip3 install tokenize
pip3 install pillow
The "Failed building wheel" errors can be ignored btw. Those are not required, but if you want to get rid of the error message:

Code: Select all

pip3 install wheel

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

Re: How to install pillow for python3

Post by dietpiOK » Sun May 26, 2019 11:02 am

there is no pip3 command and "apt-get install pip3" will not work...

apt-get install python3-pip tells me that it is already installed and I can find "pip", "pip2" and "pip2.7" on my raspi.

setuptools are also installed and when trying to install "tokenize" I can see the following:

[email protected]:~# pip install tokenize
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting tokenize
ERROR: Could not find a version that satisfies the requirement tokenize (from versions: none)
ERROR: No matching distribution found for tokenize

Any idea?

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 May 26, 2019 2:27 pm

@dietpiOK
Did you even install PIP for Python3 then? G_AGI python3-pip

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

Re: How to install pillow for python3

Post by dietpiOK » Wed May 29, 2019 2:29 pm

[email protected]:~# G_AGI python3-pip
[ OK ] Root access verified.
[ INFO ] APT installation for: python3-pip, please wait...
[ OK ] G_AGI python3-pip

seems so...

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

Re: How to install pillow for python3

Post by MichaIng » Wed May 29, 2019 6:34 pm

Very strange, the pip3 binary is definitely part of that package. Can you run: dpkg -L python3-pip

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

Re: How to install pillow for python3

Post by dietpiOK » Wed May 29, 2019 8:44 pm

[email protected]:~# dpkg -L python3-pip
/.
/usr
/usr/bin
/usr/bin/pip3
/usr/lib
/usr/lib/python3
/usr/lib/python3/dist-packages
/usr/lib/python3/dist-packages/pip
/usr/lib/python3/dist-packages/pip/__init__.py
/usr/lib/python3/dist-packages/pip/__main__.py
/usr/lib/python3/dist-packages/pip/_vendor
/usr/lib/python3/dist-packages/pip/_vendor/__init__.py
/usr/lib/python3/dist-packages/pip/basecommand.py
/usr/lib/python3/dist-packages/pip/baseparser.py
/usr/lib/python3/dist-packages/pip/cmdoptions.py
/usr/lib/python3/dist-packages/pip/commands
/usr/lib/python3/dist-packages/pip/commands/__init__.py
/usr/lib/python3/dist-packages/pip/commands/check.py
/usr/lib/python3/dist-packages/pip/commands/completion.py
/usr/lib/python3/dist-packages/pip/commands/download.py
/usr/lib/python3/dist-packages/pip/commands/freeze.py
/usr/lib/python3/dist-packages/pip/commands/hash.py
/usr/lib/python3/dist-packages/pip/commands/help.py
/usr/lib/python3/dist-packages/pip/commands/install.py
/usr/lib/python3/dist-packages/pip/commands/list.py
/usr/lib/python3/dist-packages/pip/commands/search.py
/usr/lib/python3/dist-packages/pip/commands/show.py
/usr/lib/python3/dist-packages/pip/commands/uninstall.py
/usr/lib/python3/dist-packages/pip/commands/wheel.py
/usr/lib/python3/dist-packages/pip/compat
/usr/lib/python3/dist-packages/pip/compat/__init__.py
/usr/lib/python3/dist-packages/pip/compat/dictconfig.py
/usr/lib/python3/dist-packages/pip/download.py
/usr/lib/python3/dist-packages/pip/exceptions.py
/usr/lib/python3/dist-packages/pip/index.py
/usr/lib/python3/dist-packages/pip/locations.py
/usr/lib/python3/dist-packages/pip/models
/usr/lib/python3/dist-packages/pip/models/__init__.py
/usr/lib/python3/dist-packages/pip/models/index.py
/usr/lib/python3/dist-packages/pip/operations
/usr/lib/python3/dist-packages/pip/operations/__init__.py
/usr/lib/python3/dist-packages/pip/operations/check.py
/usr/lib/python3/dist-packages/pip/operations/freeze.py
/usr/lib/python3/dist-packages/pip/pep425tags.py
/usr/lib/python3/dist-packages/pip/req
/usr/lib/python3/dist-packages/pip/req/__init__.py
/usr/lib/python3/dist-packages/pip/req/req_file.py
/usr/lib/python3/dist-packages/pip/req/req_install.py
/usr/lib/python3/dist-packages/pip/req/req_set.py
/usr/lib/python3/dist-packages/pip/req/req_uninstall.py
/usr/lib/python3/dist-packages/pip/status_codes.py
/usr/lib/python3/dist-packages/pip/utils
/usr/lib/python3/dist-packages/pip/utils/__init__.py
/usr/lib/python3/dist-packages/pip/utils/appdirs.py
/usr/lib/python3/dist-packages/pip/utils/build.py
/usr/lib/python3/dist-packages/pip/utils/deprecation.py
/usr/lib/python3/dist-packages/pip/utils/encoding.py
/usr/lib/python3/dist-packages/pip/utils/filesystem.py
/usr/lib/python3/dist-packages/pip/utils/glibc.py
/usr/lib/python3/dist-packages/pip/utils/hashes.py
/usr/lib/python3/dist-packages/pip/utils/logging.py
/usr/lib/python3/dist-packages/pip/utils/outdated.py
/usr/lib/python3/dist-packages/pip/utils/packaging.py
/usr/lib/python3/dist-packages/pip/utils/setuptools_build.py
/usr/lib/python3/dist-packages/pip/utils/ui.py
/usr/lib/python3/dist-packages/pip/vcs
/usr/lib/python3/dist-packages/pip/vcs/__init__.py
/usr/lib/python3/dist-packages/pip/vcs/bazaar.py
/usr/lib/python3/dist-packages/pip/vcs/git.py
/usr/lib/python3/dist-packages/pip/vcs/mercurial.py
/usr/lib/python3/dist-packages/pip/vcs/subversion.py
/usr/lib/python3/dist-packages/pip/wheel.py
/usr/lib/python3/dist-packages/pip-9.0.1.egg-info
/usr/lib/python3/dist-packages/pip-9.0.1.egg-info/PKG-INFO
/usr/lib/python3/dist-packages/pip-9.0.1.egg-info/dependency_links.txt
/usr/lib/python3/dist-packages/pip-9.0.1.egg-info/entry_points.txt
/usr/lib/python3/dist-packages/pip-9.0.1.egg-info/not-zip-safe
/usr/lib/python3/dist-packages/pip-9.0.1.egg-info/requires.txt
/usr/lib/python3/dist-packages/pip-9.0.1.egg-info/top_level.txt
/usr/share
/usr/share/doc
/usr/share/doc/python3-pip
/usr/share/doc/python3-pip/changelog.Debian.gz
/usr/share/doc/python3-pip/changelog.gz
/usr/share/doc/python3-pip/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/pip3.1.gz

From /usr/bin I cannot start pip3 command. There is only a pip2 command.

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

Re: How to install pillow for python3

Post by dietpiOK » Wed May 29, 2019 8:44 pm

How can I uninstall and reinstall pip3 or python?

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

Re: How to install pillow for python3

Post by dietpiOK » Wed May 29, 2019 9:45 pm

i uninstalled and reinstalled python pin with the dietpi-software tool.
Now I can use pip 3 command but I am still not able to install pillow :(

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-g3b5ble8/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-ljxmuks_-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-g3b5ble8/pillow/

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

Re: How to install pillow for python3

Post by dietpiOK » Mon Jun 03, 2019 11:09 am

Any advise?

Post Reply