Can't build any Python version on Mac OS X 13.4 with pyenv
Asked Answered
G

2

4

I recently install the latest Mac OSX upgrade (currently running 13.4) and I can't build Python with pyenv anymore (I suspect it's related although not 100% sure).

pyenv was installed through brew install (I'm using 2.3.19), and was able to build Python 3.10.4 just fine. I wanted to reinstall the same Python version I was using (3.10.4) and got this error message:

BUILD FAILED (OS X 13.4 using python-build 20180424)

Inspect or clean up the working tree at /var/folders/5j/xmpgv80d18s_r90jvtyftpph0000gn/T/python-build.20230611185357.74229
Results logged to /var/folders/5j/xmpgv80d18s_r90jvtyftpph0000gn/T/python-build.20230611185357.74229.log

Last 10 log lines:
  File "/private/var/folders/5j/xmpgv80d18s_r90jvtyftpph0000gn/T/python-build.20230611185357.74229/Python-3.10.12/Lib/ensurepip/__init__.py", line 287, in _main
    return _bootstrap(
  File "/private/var/folders/5j/xmpgv80d18s_r90jvtyftpph0000gn/T/python-build.20230611185357.74229/Python-3.10.12/Lib/ensurepip/__init__.py", line 203, in _bootstrap
    return _run_pip([*args, *_PACKAGE_NAMES], additional_paths)
  File "/private/var/folders/5j/xmpgv80d18s_r90jvtyftpph0000gn/T/python-build.20230611185357.74229/Python-3.10.12/Lib/ensurepip/__init__.py", line 104, in _run_pip
    return subprocess.run(cmd, check=True).returncode
  File "/private/var/folders/5j/xmpgv80d18s_r90jvtyftpph0000gn/T/python-build.20230611185357.74229/Python-3.10.12/Lib/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/private/var/folders/5j/xmpgv80d18s_r90jvtyftpph0000gn/T/python-build.20230611185357.74229/Python-3.10.12/python.exe', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/var/folders/5j/xmpgv80d18s_r90jvtyftpph0000gn/T/tmp18yfiiwu/setuptools-65.5.0-py3-none-any.whl\', \'/var/folders/5j/xmpgv80d18s_r90jvtyftpph0000gn/T/tmp18yfiiwu/pip-23.0.1-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/var/folders/5j/xmpgv80d18s_r90jvtyftpph0000gn/T/tmp18yfiiwu\', \'--root\', \'/\', \'--upgrade\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' died with <Signals.SIGABRT: 6>.
make: *** [install] Error 1 

(I don't really get why it tries to do anything with a .exe file...)

Since then, I tried almost lead I could find, including reinstalling pyenv, reinstalling xcode-select, updating homebrew and upgrading all packages. Nothing helped.

I've tried installing 3.9, 3.10 and 3.11 (latest with each). On 3.9 and 3.10 I get the same error with the exe file. When I try 3.11 I get something else:

Undefined symbols for architecture x86_64:
  "_libintl_bindtextdomain", referenced from:
      __locale_bindtextdomain in _localemodule.o
  "_libintl_dcgettext", referenced from:
      __locale_dcgettext in _localemodule.o
  "_libintl_dgettext", referenced from:
      __locale_dgettext in _localemodule.o
  "_libintl_gettext", referenced from:
      __locale_gettext in _localemodule.o
  "_libintl_setlocale", referenced from:
      __locale_setlocale in _localemodule.o
      __locale_localeconv in _localemodule.o
  "_libintl_textdomain", referenced from:
      __locale_textdomain in _localemodule.o
ld: symbol(s) not found for architecture x86_64
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Programs/_freeze_module] Error 1

BUILD FAILED (OS X 13.4 using python-build 20180424)

Inspect or clean up the working tree at /var/folders/5j/xmpgv80d18s_r90jvtyftpph0000gn/T/python-build.20230611184550.63292
Results logged to /var/folders/5j/xmpgv80d18s_r90jvtyftpph0000gn/T/python-build.20230611184550.63292.log

Last 10 log lines:
  "_libintl_gettext", referenced from:
      __locale_gettext in _localemodule.o
  "_libintl_setlocale", referenced from:
      __locale_setlocale in _localemodule.o
      __locale_localeconv in _localemodule.o
  "_libintl_textdomain", referenced from:
      __locale_textdomain in _localemodule.o
ld: symbol(s) not found for architecture x86_64
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Programs/_freeze_module] Error 1

Does anyone have any lead? I feel like every time I'm upgrading my Mac OS, I completely break my whole dev environment...

Gimcrack answered 11/6, 2023 at 16:44 Comment(0)
A
0

I hit this issue myself, and found a solution on the pyenv issue tracker, Installing python on MacBook Pro M2 - ensurepip "died with <Signals.SIGABRT: 6>.".

  1. Get all my installed formulae with brew list, and save the list for their reinstallation.
  2. Uninstall Homebrew.
  3. Satisfy requirements to reinstall Homebrew.
  4. Reinstall Homebrew with /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)".
  5. Reinstall your formulae with brew install [space-separated list of formulae]. This probably includes pyenv, but if not, add it to your list to install. Note, if you migrated from an old macOS, then some brew formulae might be deprecated or not installable, such as [email protected]. You will need to remove and omit these items from your list and attempt to install the remaining list items.
  6. Reconfigure formulae. For example, Apache's configuration moved from /usr/local/etc/httpd/ to /opt/homebrew/etc/httpd/.

Finally the suggestion to first try reinstalling all the formulae did not work for me. I had to take this sledgehammer approach to get it to work.

Anachronous answered 6/8, 2023 at 20:54 Comment(0)
M
0

I got this problem after I updated macOS to Sonoma 14.4

I was able to fix it thru reinstalling mac ports.
This is the official instruction.

Musquash answered 14/3, 2024 at 23:10 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.