question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot build pil/pillow

See original GitHub issue

Hi,

I am using a VENV, the build for kivy is now successful but I cannot build pillow. I assume it has to do with setuptools and the PYTHONPATH as shown in the log:

(venv) geoffreykasenbacher@Geoffreys-MBP ~ % toolchain build pillow
[INFO    ] Building with 4 processes, where supported
[INFO    ] Want to build ['pillow']
[INFO    ] Loaded recipe pillow (depends of ['hostpython3', 'host_setuptools3', 'freetype', 'libjpeg', 'python3', 'ios'], optional are [])
[INFO    ] Loaded recipe hostpython3 (depends of ['hostlibffi', 'hostopenssl'], optional are [])
[INFO    ] Loaded recipe host_setuptools3 (depends of ['openssl', 'hostpython3'], optional are [])
[INFO    ] Loaded recipe freetype (depends of [], optional are [])
[INFO    ] Loaded recipe libjpeg (depends of [], optional are [])
[INFO    ] Loaded recipe python3 (depends of ['hostpython3', 'libffi', 'openssl'], optional are [])
[INFO    ] Loaded recipe ios (depends of ['python'], optional are [])
[INFO    ] Loaded recipe hostlibffi (depends of [], optional are [])
[INFO    ] Loaded recipe hostopenssl (depends of [], optional are [])
[INFO    ] Loaded recipe openssl (depends of [], optional are [])
[INFO    ] Loaded recipe libffi (depends of [], optional are [])
[INFO    ] Loaded recipe python (depends of ['python3'], optional are [])
[INFO    ] Build order is ['freetype', 'hostlibffi', 'hostopenssl', 'libffi', 'libjpeg', 'openssl', 'hostpython3', 'host_setuptools3', 'python3', 'python', 'ios', 'pillow']
[INFO    ] Recipe order is ['freetype', 'hostlibffi', 'hostopenssl', 'libffi', 'libjpeg', 'openssl', 'hostpython3', 'host_setuptools3', 'python3', 'ios', 'pillow']
[INFO    ] Include dir added: {arch.arch}/freetype
[INFO    ] Include dir added: {arch.arch}/hostlibffi
[INFO    ] Include dir added: {arch.arch}/ffi
[INFO    ] Include dir added: {arch.arch}/libjpeg
[INFO    ] Include dir added: {arch.arch}/openssl
[INFO    ] Global: hostpython located at /Users/geoffreykasenbacher/dist/hostpython3/bin/python
[INFO    ] Global: hostpgen located at /Users/geoffreykasenbacher/dist/hostpython3/bin/pgen
[DEBUG   ] Cached result: Download freetype. Ignoring
[DEBUG   ] Cached result: Extract freetype. Ignoring
[DEBUG   ] Cached result: Build_all freetype. Ignoring
[DEBUG   ] Cached result: Download hostlibffi. Ignoring
[DEBUG   ] Cached result: Extract hostlibffi. Ignoring
[INFO    ] Build hostlibffi for x86_64 (filtered)
[DEBUG   ] Cached result: Build hostlibffi. Ignoring
[DEBUG   ] New State: hostlibffi.build_all at 2020-07-11 09:58:27.049845
[DEBUG   ] Cached result: Download hostopenssl. Ignoring
[DEBUG   ] Cached result: Extract hostopenssl. Ignoring
[DEBUG   ] Cached result: Build_all hostopenssl. Ignoring
[DEBUG   ] Cached result: Download libffi. Ignoring
[DEBUG   ] Cached result: Extract libffi. Ignoring
[DEBUG   ] Cached result: Build_all libffi. Ignoring
[DEBUG   ] Cached result: Download libjpeg. Ignoring
[DEBUG   ] Cached result: Extract libjpeg. Ignoring
[DEBUG   ] Cached result: Build_all libjpeg. Ignoring
[DEBUG   ] Cached result: Download openssl. Ignoring
[DEBUG   ] Cached result: Extract openssl. Ignoring
[DEBUG   ] Cached result: Build_all openssl. Ignoring
[DEBUG   ] Cached result: Download hostpython3. Ignoring
[DEBUG   ] Cached result: Extract hostpython3. Ignoring
[DEBUG   ] Cached result: Build_all hostpython3. Ignoring
[DEBUG   ] Cached result: Download host_setuptools3. Ignoring
[DEBUG   ] Cached result: Extract host_setuptools3. Ignoring
[DEBUG   ] Cached result: Build_all host_setuptools3. Ignoring
[DEBUG   ] Cached result: Download python3. Ignoring
[DEBUG   ] Cached result: Extract python3. Ignoring
[DEBUG   ] Cached result: Build_all python3. Ignoring
[DEBUG   ] Cached result: Download ios. Ignoring
[DEBUG   ] Cached result: Extract ios. Ignoring
[DEBUG   ] Cached result: Build_all ios. Ignoring
[DEBUG   ] Cached result: Download pillow. Ignoring
[DEBUG   ] Cached result: Extract pillow. Ignoring
[INFO    ] Build_all pillow
[INFO    ] Build pillow for x86_64, arm64 (filtered)
[DEBUG   ] Cached result: Build pillow. Ignoring
[DEBUG   ] Cached result: Build pillow. Ignoring
[INFO    ] Create lipo library for pillow
[INFO    ] Lipo pillow to /Users/geoffreykasenbacher/dist/lib/libpillow.a
[DEBUG   ] Cached result: Make_lipo pillow. Ignoring
[INFO    ] Install include files for pillow
[DEBUG   ] Cached result: Install_include pillow. Ignoring
[INFO    ] Install frameworks for pillow
[DEBUG   ] Cached result: Install_frameworks pillow. Ignoring
[INFO    ] Install sources for pillow
[DEBUG   ] Cached result: Install_sources pillow. Ignoring
[INFO    ] Install python deps for pillow
[DEBUG   ] Cached result: Install_python_deps pillow. Ignoring
[INFO    ] Install pillow
[INFO    ] CC and CXX will not use ccache
[INFO    ] Running Shell: /Users/geoffreykasenbacher/dist/hostpython3/bin/python ('setup.py', 'install', '--prefix', '/Users/geoffreykasenbacher/dist/root/python3') {'_env': {'CC': '/var/folders/72/5r62rbzx09qdvpzp_xjt1b940000gn/T/tmp3pdv94bp', 'CXX': '/var/folders/72/5r62rbzx09qdvpzp_xjt1b940000gn/T/tmpm90_d_q2', 'AR': '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar', 'LD': '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld', 'OTHER_CFLAGS': '-I/Users/geoffreykasenbacher/dist/include/x86_64/freetype -I/Users/geoffreykasenbacher/dist/include/x86_64/hostlibffi -I/Users/geoffreykasenbacher/dist/include/x86_64/ffi -I/Users/geoffreykasenbacher/dist/include/x86_64/libjpeg -I/Users/geoffreykasenbacher/dist/include/x86_64/openssl -I/Users/geoffreykasenbacher/dist/include/x86_64', 'OTHER_LDFLAGS': '-L/Users/geoffreykasenbacher/dist/lib', 'CFLAGS': '-I/Users/geoffreykasenbacher/dist/include/x86_64/freetype -I/Users/geoffreykasenbacher/dist/include/x86_64/libjpeg -arch x86_64', 'LDFLAGS': '-arch x86_64 -L/Users/geoffreykasenbacher/dist/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/lib -miphoneos-version-min=8.0', 'IOSROOT': '/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/kivy_ios', 'IOSSDKROOT': '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk', 'LDSHARED': '/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/kivy_ios/tools/liblink', 'ARM_LD': '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld', 'ARCH': 'x86_64', 'C_INCLUDE_PATH': '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/include', 'LIBRARY_PATH': '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.5.sdk/usr/lib', 'PATH': '/Users/geoffreykasenbacher/venv/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin', 'PYTHONPATH': '/Users/geoffreykasenbacher/dist/root/python3/lib/python3.7/site-packages'}, '_iter': True, '_out_bufsize': 1, '_err_to_out': True}
[DEBUG   ] running install
[DEBUG   ] Checking .pth file support in /Users/geoffreykasenbacher/dist/root/python3/lib/python3.8/site-packages/
[DEBUG   ] /Users/geoffreykasenbacher/dist/hostpython3/bin/python -E -c pass
[DEBUG   ] TEST FAILED: /Users/geoffreykasenbacher/dist/root/python3/lib/python3.8/site-packages/ does NOT support .pth files
[DEBUG   ] error: bad install directory or PYTHONPATH
[DEBUG   ] 
[DEBUG   ] You are attempting to install a package to a directory that is not
[DEBUG   ] on PYTHONPATH and which Python does not read ".pth" files from.  The
[DEBUG   ] installation directory you specified (via --install-dir, --prefix, or
[DEBUG   ] the distutils default setting) was:
[DEBUG   ] 
[DEBUG   ]     /Users/geoffreykasenbacher/dist/root/python3/lib/python3.8/site-packages/
[DEBUG   ] 
[DEBUG   ] and your PYTHONPATH environment variable currently contains:
[DEBUG   ] 
[DEBUG   ]     '/Users/geoffreykasenbacher/dist/root/python3/lib/python3.7/site-packages'
[DEBUG   ] 
[DEBUG   ] Here are some of your options for correcting the problem:
[DEBUG   ] 
[DEBUG   ] * You can choose a different installation directory, i.e., one that is
[DEBUG   ]   on PYTHONPATH or supports .pth files
[DEBUG   ] 
[DEBUG   ] * You can add the installation directory to the PYTHONPATH environment
[DEBUG   ]   variable.  (It must then also be on PYTHONPATH whenever you run
[DEBUG   ]   Python and want to use the package(s) you are installing.)
[DEBUG   ] 
[DEBUG   ] * You can set up the installation directory to support ".pth" files by
[DEBUG   ]   using one of the approaches described here:
[DEBUG   ] 
[DEBUG   ]   https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations
[DEBUG   ] 
[DEBUG   ] 
[DEBUG   ] Please make the appropriate changes for your system and try again.
Exception in thread background thread for pid 16799:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/sh.py", line 1662, in wrap
    fn(*args, **kwargs)
  File "/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/sh.py", line 2606, in background_thread
    handle_exit_code(exit_code)
  File "/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/sh.py", line 2304, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/sh.py", line 877, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /Users/geoffreykasenbacher/dist/hostpython3/bin/python setup.py install --prefix /Users/geoffreykasenbacher/dist/root/python3

  STDOUT:
running install
Checking .pth file support in /Users/geoffreykasenbacher/dist/root/python3/lib/python3.8/site-packages/
/Users/geoffreykasenbacher/dist/hostpython3/bin/python -E -c pass
TEST FAILED: /Users/geoffreykasenbacher/dist/root/python3/lib/python3.8/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /Users/geoffreykasenbacher/dist/root/python3/lib/python3.8/site-packages/

and your PYTHONPATH environment variable currently contains:

    '/Users/geoffreyk... (709 more, please see e.stdout)

  STDERR:


Traceback (most recent call last):
  File "/Users/geoffreykasenbacher/venv/bin/toolchain", line 11, in <module>
    sys.exit(main())
  File "/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/kivy_ios/toolchain.py", line 1497, in main
    ToolchainCL()
  File "/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/kivy_ios/toolchain.py", line 1270, in __init__
    getattr(self, args.command)()
  File "/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/kivy_ios/toolchain.py", line 1323, in build
    build_recipes(args.recipe, ctx)
  File "/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/kivy_ios/toolchain.py", line 1121, in build_recipes
    recipe.execute()
  File "/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/kivy_ios/toolchain.py", line 700, in execute
    self.build_all()
  File "/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/kivy_ios/toolchain.py", line 85, in _cache_execution
    f(self, *args, **kwargs)
  File "/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/kivy_ios/toolchain.py", line 821, in build_all
    self.install()
  File "/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/kivy_ios/recipes/pillow/__init__.py", line 49, in install
    _env=build_env)
  File "/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/kivy_ios/toolchain.py", line 67, in shprint
    for line in cmd:
  File "/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/sh.py", line 925, in next
    self.wait()
  File "/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/sh.py", line 849, in wait
    self.handle_command_exit_code(exit_code)
  File "/Users/geoffreykasenbacher/venv/lib/python3.7/site-packages/sh.py", line 877, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1: 

  RAN: /Users/geoffreykasenbacher/dist/hostpython3/bin/python setup.py install --prefix /Users/geoffreykasenbacher/dist/root/python3

  STDOUT:
running install
Checking .pth file support in /Users/geoffreykasenbacher/dist/root/python3/lib/python3.8/site-packages/
/Users/geoffreykasenbacher/dist/hostpython3/bin/python -E -c pass
TEST FAILED: /Users/geoffreykasenbacher/dist/root/python3/lib/python3.8/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /Users/geoffreykasenbacher/dist/root/python3/lib/python3.8/site-packages/

and your PYTHONPATH environment variable currently contains:

    '/Users/geoffreyk... (709 more, please see e.stdout)

  STDERR:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:20 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Cheatermancommented, Sep 30, 2020

Thanks @Zen-CODE 😄 see #556 for more information.

1reaction
Zen-CODEcommented, Jul 21, 2020

Great stuff! Thanks for the feedback! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Pip can't install pillow - Stack Overflow
When trying to install pillow using pip it produces this error. I have tried reinstalling setup tools and it has had no effect...
Read more >
software installation - Failed to build Pillow - Ask Ubuntu
I'm using Kubuntu 16.04. I'm trying to install the TFLearn library, but it requires Pillow, which it tried to install but was failing....
Read more >
Installation - Pillow (PIL Fork) 9.3.0 documentation
Pillow and PIL cannot co-exist in the same environment. Before installing Pillow ... To install Pillow in MSYS2, see Building on Windows using...
Read more >
What Is Pillow Fort in Magic: The Gathering? - TCGplayer Infinite
Many have fond memories of building pillow forts as ... as it can not only stop attackers from being able to get in...
Read more >
Image Processing With the Python Pillow Library - Real Python
Use NumPy with Pillow for further processing; Create animations using Pillow. This tutorial provides an overview of what you can achieve with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found