Cannot install python 3.10.0 on m1 Apple silicon - ld: symbol(s) not found for architecture x86_64
Asked Answered
B

4

21

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 :-)

Basilbasilar answered 29/11, 2021 at 9:41 Comment(2)
Did you find a solution?Dibasic
Unfortunately not. But python 3.10.2 works. So that's fine for me.Basilbasilar
C
35
  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

Collencollenchyma answered 10/3, 2022 at 21:1 Comment(2)
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.Esra
brew install gettext is all I needed. Thanks man.Koslo
W
1

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.

Watertight answered 2/9, 2023 at 21:7 Comment(0)
C
-2

Combined Volodymyr answer with:

arch --arm64 pyenv install 3.7.13

and it worked

Cal answered 6/12, 2022 at 9:0 Comment(1)
I get the same error doing this...Touchstone
I
-3

This worked for me:

arch -x86_64 pyenv install 3.10.4
Intervene answered 3/12, 2022 at 12:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.