Skip to content
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

Python 2 - Try install pillow 6.0 instead pillow 4.0 on a ARMHF Debian stretch stable OS and make errors #3806

Closed
MantaRayDeeJay opened this issue Apr 24, 2019 · 10 comments
Labels

Comments

@MantaRayDeeJay
Copy link

What did you do?

I'm trying install bCNC (https://github.com/vlachoudis/bCNC) that require the Pillow module.
I have also tried to install manually the pillow module :
python2 -m pip install --upgrade 'Pillow>=4.0'

What did you expect to happen?

I have a DEBIAN Stretch Stable OS, so I thought it will install Pillow 4.0
https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=python-pil

What actually happened?

the program try to install Pillow 6.0 that make some errors and goes wrong.

What are your OS, Python and Pillow versions?

  • OS:
    Debian GNU/Linux 9 (stretch)
    Linux orangepizero 4.19.25-sunxi More psd files handled #5.78 SMP Mon Apr 8 07:46:22 CEST 2019 armv7l GNU/Linux
  • Python:
    Python 2.7.13
  • Pillow:
    Pillow v4.0 or v6.0 ???

Please include code that reproduces the issue and whenever possible, an image that demonstrates the issue. Please upload images to GitHub, not to third-party file hosting sites. If necessary, add the image to a zip or tar archive.

The best reproductions are self-contained scripts with minimal dependencies. If you are using a framework such as plone, Django, or buildout, try to replicate the issue just using Pillow.

python2 -m pip install --upgrade 'Pillow>=4.0'

OPi Zero - Debian Stretch - Pillow 4.0.0 install manually - Error.txt

@ghost
Copy link

ghost commented Apr 24, 2019

It looks like you're missing python-dev. https://pillow.readthedocs.io/en/stable/installation.html#building-from-source

@radarhere
Copy link
Member

https://pip.pypa.io/en/stable/reference/pip_install/

Once pip has the set of requirements to satisfy, it chooses which version of each requirement to install using the simple rule that the latest version that satisfies the given constraints will be installed

@MantaRayDeeJay
Copy link
Author

@hsoft It seems working better with the python-dev
I have tried to install without a sudo in this way : python2 -m pip install --upgrade 'Pillow>=4.0'
I have a problem at the end :

running install_lib
    creating /usr/local/lib/python2.7/dist-packages/PIL
    error: could not create '/usr/local/lib/python2.7/dist-packages/PIL': Permission denied

Then, I have tried to reinstall it with a sudo prefix : sudo python2 -m pip install --upgrade 'Pillow>=4.0'
But I have had an killed error message. So I have reboot my device and try again :
An new error message : MemoryError
So what does it mean ?
I have 512MB RAM on my device, is it enough ?
I have enough free space on my SD card.
What kind of memory does speak about this error message ?
I have also seen that we can check Pillow installation by executing the selftest.py script. Where can I find this file ?

OPi Zero - Debian Stretch - Pillow 6.0.0 install manually - Error - First try.txt

OPi Zero - Debian Stretch - Pillow 6.0.0 install manually - Error - Second try (after reboot).txt

@radarhere
Copy link
Member

I don't expect selftest.py to be a part of your pip installed Pillow. However, you can find it at https://github.com/python-pillow/Pillow/blob/master/selftest.py

@MantaRayDeeJay
Copy link
Author

@hsoft Since the beginning, I have Sometimes this error when trying to install Pillow : At 99%, I have a "Killed" error message.
OPi Zero - Debian Stretch - Pillow install via pip2 - Killed Error.txt

@radarhere
Copy link
Member

radarhere commented Apr 24, 2019

I presume that the Killed and the memory error have the same root problem - see https://stackoverflow.com/questions/37643451/why-does-my-numpy-install-keeps-being-killed for another instance of the problem where memory is deemed to be the issue. https://stackoverflow.com/questions/30550235/pip-install-killed might help.

@MantaRayDeeJay
Copy link
Author

@radarhere I can confirm the memory error with the dmesg cmd :

[ 1882.949982] [   2810]     0  2810     1567        2    14336       93             0 sudo
[ 1882.949991] [   2811]     0  2811   110260    59857   438272    42232             0 pip2
[ 1882.949995] Out of memory: Kill process 2811 (pip2) score 540 or sacrifice child
[ 1882.950020] Killed process 2811 (pip2) total-vm:441040kB, anon-rss:239420kB, file-rss:8kB, shmem-rss:0kB
[ 1883.165945] oom_reaper: reaped process 2811 (pip2), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
pizero@orangepizero:/$

@MantaRayDeeJay
Copy link
Author

It seems that I have finally succeeded to install Pillow v6.0.0 by adding the --no-cache-dir option :

pizero@orangepizero:/$ sudo pip2 install Pillow --no-cache-dir
Collecting Pillow
  Downloading https://files.pythonhosted.org/packages/81/1a/6b2971adc1bca55b9a53ed1efa372acff7e8b9913982a396f3fa046efaf8/Pillow-6.0.0.tar.gz (29.5MB)
    100% |████████████████████████████████| 29.5MB 1.4MB/s
Installing collected packages: Pillow
  Running setup.py install for Pillow ... done
Successfully installed Pillow-6.0.0
pizero@orangepizero:/$
pizero@orangepizero:/$ sudo pip2 list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
Pillow (6.0.0)
pip (9.0.1)
setuptools (33.1.1)
pizero@orangepizero:/$

@radarhere
Copy link
Member

Congratulations. Is that all that you were after with this issue?

@MantaRayDeeJay
Copy link
Author

@radarhere Yes, it sounds good !!! You can close the issue. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants