16

I am trying to get python 3.10.0 installed on my Apple M1 Silicon.

Installing via asdf venv manager. 3.7.9 and 3.9.4 work without any issues but installing 3.10.0 causes the following error:

Last 10 log lines:
  "_libintl_textdomain", referenced from:
      __locale_textdomain in libpython3.10.a(_localemodule.o)
      __locale_textdomain in libpython3.10.a(_localemodule.o)
ld: symbol(s) not found for architecture x86_64
ld: symbol(s) not found for architecture x86_64
clang: clangerror: linker command failed with exit code 1 (use -v to see invocation)
: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Programs/_testembed] Error 1
make: *** Waiting for unfinished jobs....
make: *** [python.exe] Error 1

cmake version 3.22.0

Apple clang version 13.0.0 (clang-1300.0.29.3) Target: x86_64-apple-darwin21.1.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

What I tried:

export ARCHFLAGS="-arch arm64"

and all the suggestions from

Can't install Python 3.10.0 with pyenv on MacOS

Thank you so much in advance, it's driving me nuts :-)

cocoonkid
  • 163
  • 1
  • 6

4 Answers4

30
  1. First install gettext:
brew install gettext
  1. Then export flags:
export LDFLAGS="-L/opt/homebrew/lib"; export CPPFLAGS="-I/opt/homebrew/include"
  1. Finaly install python:
pyenv install 3.10.0

It worked for me. I found it here https://github.com/pyenv/pyenv/issues/1877#issuecomment-962514298

Volodymyr
  • 490
  • 5
  • 9
  • This worked for me! Just notice that if you're not on Apple M1 but the "regular" Intel ones - use `/usr/local/include` and `/usr/local/lib` instead. – Zach Moshe Jun 12 '23 at 16:22
0

Combined Volodymyr answer with:

arch --arm64 pyenv install 3.7.13

and it worked

jnowak
  • 641
  • 1
  • 6
  • 13
0

I've got the same issues after migrating from x86 to ARM architecture using Migration Assistant. I managed to fix it by removing the gettext, openssl, readline, and tcl-tk packages from /usr/local/Cellar (the directory dedicated for x86 architecture executables).

I find that identifying and removing the packages which cause compatibility issues is the most optimal solution for such issues instead of potentially running into the same issues again.

Tomas Liubinas
  • 181
  • 2
  • 7
-1

This worked for me:

arch -x86_64 pyenv install 3.10.4
Roman
  • 624
  • 5
  • 15