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

Pillow 5.4.0 cannot be installed on Termux #3526

Closed
valpogus opened this issue Jan 2, 2019 · 5 comments
Closed

Pillow 5.4.0 cannot be installed on Termux #3526

valpogus opened this issue Jan 2, 2019 · 5 comments
Labels
Installation Usually a problem with …

Comments

@valpogus
Copy link

valpogus commented Jan 2, 2019

What did you do?

pip3 install --upgrade Pillow

What did you expect to happen?

Pillow is upgraded to version 5.4.0

What actually happened?

running build_ext
Traceback (most recent call last):
File "", line 1, in
File "/data/data/com.termux/files/usr/tmp/pip-install-XXXXXXXX/pillow/setup.py", line 800, in
zip_safe=not (debug_build() or PLATFORM_MINGW), )
File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/setuptools/init.py", line 143, in setup
return distutils.core.setup(**attrs)
File "/data/data/com.termux/files/usr/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/data/data/com.termux/files/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/data/data/com.termux/files/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/data/data/com.termux/files/usr/lib/python3.7/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/data/data/com.termux/files/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/data/data/com.termux/files/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/data/data/com.termux/files/usr/lib/python3.7/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/data/data/com.termux/files/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/data/data/com.termux/files/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/data/data/com.termux/files/usr/lib/python3.7/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/data/data/com.termux/files/usr/tmp/pip-install-XXXXXXXX/pillow/setup.py", line 416, in build_extensions
for dirname in _find_library_dirs_ldconfig():
TypeError: 'NoneType' object is not iterable

What are your OS, Python and Pillow versions?

  • OS: Termux
  • Python: 3.7.2
  • Pillow: 5.4.0

I think the error happens in the function _find_library_dirs_ldconfig, where the executable "/sbin/ldconfig" is called. This executable does not exist on Termux, making the function return None.

[...]
        args = ['/sbin/ldconfig', '-p']
[...]
    null = open(os.devnull, 'wb')
    try:
        with null:
            p = subprocess.Popen(args,
                                 stderr=null,
                                 stdout=subprocess.PIPE,
                                 env=env)
    except OSError:  # E.g. command not found
        return None
[...]

Previous versions can be installed without a problem (as long as the necessary dev packages are installed).

@hugovk
Copy link
Member

hugovk commented Jan 2, 2019

_find_library_dirs_ldconfig was added in #3245.

@pslacerda, please could you check it?

@hugovk hugovk added the Installation Usually a problem with … label Jan 2, 2019
@pslacerda
Copy link
Contributor

@valpogus your development environment should be very funny: Termux on Android on Linux with some hardware virtualization!

@hugovk I'm looking it right now and ping you back soon.

@pslacerda
Copy link
Contributor

_find_library_dirs_ldconfig should return a empty list instead of None, so it can go through Termux/ANDROID_ROOT code. Or return a generator instead.

I'm worried about /include for Termux (the comments talk about) that I don't see even before the introduction of _find_library_dirs_ldconfig. Maybe I missed something.

pslacerda added a commit to pslacerda/Pillow that referenced this issue Jan 2, 2019
`_find_library_dirs_ldconfig` can return an empty list when `ldconfig` is missing, then `setup.py` can continue guessing library directories.

fixes python-pillow#3526
@wiredfool
Copy link
Member

Initial termux support was done on a chromebook in the termux environment. It's possible that this can be tested in termux on docker.

@pslacerda
Copy link
Contributor

pslacerda commented Jan 2, 2019

Such a rare OS! I managed to install Pillow on #3529. It was developed on an Android phone because was simple to fix. Only python setup.py install was needed.

Tests on Docker seems very nice also.

@hugovk hugovk mentioned this issue Jan 3, 2019
27 tasks
hugovk pushed a commit that referenced this issue Jan 5, 2019
`_find_library_dirs_ldconfig` can return an empty list when `ldconfig` is missing, then `setup.py` can continue guessing library directories.

fixes #3526
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Installation Usually a problem with …
Projects
None yet
Development

No branches or pull requests

4 participants