-
Notifications
You must be signed in to change notification settings - Fork 242
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
Unable to compile python3 from inside venv -- missing pyconfig.h #401
Comments
I suspect it's a "config-phase" issue, can you please post full logs? |
sorry for the delay, here is the full log: https://gist.github.com/s1113950/ff4523b39fbdfbfeff8d74679851b56f (too long to be a comment) |
Just tried new hash |
@misl6 I can confirm that |
Was able to get python to build by running this command from this folder manually:
which was the command dumped by (from what I can tell):
so it could be a path issue possibly? |
@tito I'm still blocked though because the toolchain.py script route fails with the same error even after a manual compilation of |
I removed my virtualenv and set |
We saw that bug recently on p4a with macos host. The fix was to pin |
Running the freshly compiled host python binary from another Python process (e.g. sh module or os.system()) may get wrongly detected as if it was ran directly from the venv. This happens when `pyvenv.cfg` is present (e.g. venv/pyvenv.cfg). It makes `sysconfig.is_python_build()` returns `False` instead of `True` since it's using the compiled interpreter (e.g. ./build-dir/python). https://docs.python.org/3/library/sysconfig.html#sysconfig.is_python_build https://github.com/python/cpython/blob/v3.8.2/Lib/sysconfig.py#L127 This is because the `sys._home` attribute is used during the detection. The issue was first see in macOS which generates the `pyvenv.cfg` upon `venv` module use. To compare both behaviours, try the following within and without a venv: ```python import os os.system("./build-dir/python -E -c 'import sysconfig; print(sysconfig._sys_home)'") ``` One would return `/usr/local/bin` and the other `None` Refs: - kivy/kivy-ios#401 - kivy#2063
Running the freshly compiled host python binary from another Python process (e.g. sh module or os.system()) may get wrongly detected as if it was ran directly from the venv. This happens when `pyvenv.cfg` is present (e.g. venv/pyvenv.cfg). It makes `sysconfig.is_python_build()` returns `False` instead of `True` since it's using the compiled interpreter (e.g. ./build-dir/python). https://docs.python.org/3/library/sysconfig.html#sysconfig.is_python_build https://github.com/python/cpython/blob/v3.8.2/Lib/sysconfig.py#L127 This is because the `sys._home` attribute is used during the detection. The issue was first seen in macOS venv which generates the `pyvenv.cfg`. To compare both behaviours, try the following within and without a venv: ```python import os os.system("./build-dir/python -E -c 'import sysconfig; print(sysconfig._sys_home)'") ``` One would return `/usr/local/bin` and the other `None` Refs: - kivy/kivy-ios#401 - kivy#2063
Running the freshly compiled host python binary from another Python process (e.g. sh module or os.system()) may get wrongly detected as if it was ran directly from the venv. This happens when `pyvenv.cfg` is present (e.g. venv/pyvenv.cfg). It makes `sysconfig.is_python_build()` returns `False` instead of `True` since it's using the compiled interpreter (e.g. ./build-dir/python). https://docs.python.org/3/library/sysconfig.html#sysconfig.is_python_build https://github.com/python/cpython/blob/v3.8.2/Lib/sysconfig.py#L127 This is because the `sys._home` attribute is used during the detection. The issue was first seen in macOS venv which generates the `pyvenv.cfg`. To compare both behaviours, try the following within and without a venv: ```python import os os.system("./build-dir/python -E -c 'import sysconfig; print(sysconfig._sys_home)'") ``` One would return `/usr/local/bin` and the other `None` Refs: - kivy/kivy-ios#401 - kivy#2063
Running the freshly compiled host python binary from another Python process (e.g. sh module or os.system()) may get wrongly detected as if it was ran directly from the venv. This happens when `pyvenv.cfg` is present (e.g. venv/pyvenv.cfg). It makes `sysconfig.is_python_build()` returns `False` instead of `True` since it's using the compiled interpreter (e.g. ./build-dir/python). https://docs.python.org/3/library/sysconfig.html#sysconfig.is_python_build https://github.com/python/cpython/blob/v3.8.2/Lib/sysconfig.py#L127 This is because the `sys._home` attribute is used during the detection. The issue was first seen in macOS venv which generates the `pyvenv.cfg`. To compare both behaviours, try the following within and without a venv: ```python import os os.system("./build-dir/python -E -c 'import sysconfig; print(sysconfig._sys_home)'") ``` One would return `/usr/local/bin` and the other `None` Refs: - kivy/kivy-ios#401 - kivy#2063
Running the freshly compiled python binary from another Python process (e.g. sh module or os.system()) may get wrongly detected as if it was ran directly from the venv. This happens when `pyvenv.cfg` is present (e.g. venv/pyvenv.cfg). It makes `sysconfig.is_python_build()` returns `False` instead of `True` since it's using the compiled interpreter (e.g. ./build-dir/python). https://docs.python.org/3/library/sysconfig.html#sysconfig.is_python_build https://github.com/python/cpython/blob/v3.8.2/Lib/sysconfig.py#L127 This is because the `sys._home` attribute is used during the detection. The issue was first seen in macOS venv which generates the `pyvenv.cfg`. To compare both behaviours, try the following within and without a venv: ```python import os os.system("./build-dir/python -E -c 'import sysconfig; print(sysconfig._sys_home)'") ``` One would return `/usr/local/bin` and the other `None` Refs: - kivy/kivy-ios#401 - kivy#2063
I wrote a fix in #462 could you give it a try? |
I'll try it sometime this week, thanks!! |
Running the freshly compiled python binary from another Python process (e.g. sh module or os.system()) may get wrongly detected as if it was ran directly from the venv. This happens when `pyvenv.cfg` is present (e.g. venv/pyvenv.cfg). It makes `sysconfig.is_python_build()` returns `False` instead of `True` since it's using the compiled interpreter (e.g. ./build-dir/python). https://docs.python.org/3/library/sysconfig.html#sysconfig.is_python_build https://github.com/python/cpython/blob/v3.8.2/Lib/sysconfig.py#L127 This is because the `sys._home` attribute is used during the detection. The issue was first seen in macOS venv which generates the `pyvenv.cfg`. To compare both behaviours, try the following within and without a venv: ```python import os os.system("./build-dir/python -E -c 'import sysconfig; print(sysconfig._sys_home)'") ``` One would return `/usr/local/bin` and the other `None` Refs: - kivy/kivy-ios#401 - kivy#2063
@AndreMiras I can build
Here are my steps:
if the error is due to some missing step I forgot to do on my new Mac I'll close the ticket :) Wanted to post just in case it was due to a bad compilation of |
Yes indeed like the error says you were missing a step. |
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 asbrew install python
which now installs python3.7.4; both don't work.Additionally, I tried using both
e3fa7a300fc474bb131077026f6ae198796a8dff
andmaster
, 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:
My install process:
The text was updated successfully, but these errors were encountered: