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.

Unable to compile python3 from inside venv -- missing pyconfig.h

See original GitHub issue

I’ve installed all required deps through brew but still am missing python headers.

Also tried installing python3.7.1 on the host via brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/1d4f1d5602eac539f4c02b4a82f78b3a3ed5413f/Formula/python.rb as well as brew install python which now installs python3.7.4; both don’t work.

Additionally, I tried using both e3fa7a300fc474bb131077026f6ae198796a8dff and master, but to no avail, I’ve used that hash before to create the app (on a different laptop this time) but it doesn’t appear to work on this new Mac.

Here’s my traceback:

error: [Errno 2] No such file or directory: '/Users/ryanrobertson/kivy-ios/dist/hostpython3/include/python3.7m/pyconfig.h'
[DEBUG   ] make: *** [sharedmods] Error 1
Traceback (most recent call last):
  File "./toolchain.py", line 1569, in <module>
    ToolchainCL()
  File "./toolchain.py", line 1284, in __init__
    getattr(self, args.command)()
  File "./toolchain.py", line 1325, in build
    build_recipes(args.recipe, ctx)
  File "./toolchain.py", line 1161, in build_recipes
    recipe.execute()
  File "/Users/ryanrobertson/kivy-ios/toolchain.py", line 728, in execute
    self.build_all()
  File "/Users/ryanrobertson/kivy-ios/toolchain.py", line 84, in _cache_execution
    f(self, *args, **kwargs)
  File "/Users/ryanrobertson/kivy-ios/toolchain.py", line 836, in build_all
    self.build(arch)
  File "/Users/ryanrobertson/kivy-ios/toolchain.py", line 84, in _cache_execution
    f(self, *args, **kwargs)
  File "/Users/ryanrobertson/kivy-ios/toolchain.py", line 810, in build
    self.build_arch(arch)
  File "/Users/ryanrobertson/kivy-ios/toolchain.py", line 873, in build_arch
    getattr(self, build)()
  File "/Users/ryanrobertson/kivy-ios/recipes/hostpython3/__init__.py", line 91, in build_x86_64
    _env=build_env)
  File "/Users/ryanrobertson/kivy-ios/toolchain.py", line 67, in shprint
    for line in cmd:
  File "./tools/external/sh.py", line 565, in next
    self.wait()
  File "./tools/external/sh.py", line 500, in wait
    self.handle_command_exit_code(exit_code)
  File "./tools/external/sh.py", line 516, in handle_command_exit_code
    raise exc(self.ran, self.process.stdout, self.process.stderr)
sh.ErrorReturnCode_2: 

  RAN: '/usr/bin/make -C /Users/ryanrobertson/kivy-ios/build/hostpython3/x86_64/Python-3.7.1 -j4'

  STDOUT:
clang -Qunused-arguments -fcolor-diagnostics -c -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -arch x86_64 -mmacosx-version-min=10.12 -I/Users/ryanrobertson/kivy-ios/dist/hostlibffi/usr/local/include -I/Users/ryanrobertson/kivy-ios/dist/include/x86_64/openssl --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -arch x86_64 -mmacosx-version-min=10.12 -I/Users/ryanrobertson/kivy-ios/dist/hostlibffi/usr/local/include -I/Users/ryanrobertson/kivy-ios/dist/include/x86_64/openssl  -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-mis... (141704 more, please see e.stdout)

  STDERR:

My install process:

python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
./toolchain.py build python3 kivy

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
AndreMirascommented, May 15, 2020

Yes indeed like the error says you were missing a step. By the way you can also drop your kivy-ios folder since now the install is much easier as things are published on PyPI. See the README.md for the new install instructions. I’m closing this issue as things are now working in venv

1reaction
AndreMirascommented, Feb 16, 2020

We saw that bug recently on p4a with macos host. The fix was to pin virtualenv<20, refs https://github.com/kivy/python-for-android/pull/2063

Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing pyconfig.h while installing a package - Stack Overflow
I'm using Python3 (v3.4) add-on on my Synology NAS. When I try to install package (via ssh using python3 setup.py install ) it...
Read more >
johnwheeler/flask-ask - Gitter
Hi.. how can I change the dashboards based on Alexa request.. for example if i ask alexa to show me sales dashboard, the...
Read more >
What's New In Python 3.11 — Python 3.11.1 documentation
Release, 3.11.1,, Date, December 23, 2022,, Editor, Pablo Galindo Salgado,. This article explains the new features in Python 3.11, compared to 3.10.
Read more >
issue with Py_LIMITED_API on Windows (#350) - cffi - Heptapod
We can't define Py_LIMITED_API if pyconfig.h defines Py_DEBUG or ... On older Pythons, virtualenv is still missing the python3.dll .
Read more >
Tree - rpms/python3 - CentOS Git server
The python3 binary is not yet be ... for tests that always fail within the build environment ... %build. # Regenerate the configure...
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