【问题标题】:Cannot install python 3.10.0 on m1 Apple silicon - ld: symbol(s) not found for architecture x86_64无法在 m1 Apple 硅上安装 python 3.10.0 - ld:未找到架构 x86_64 的符号
【发布时间】:2021-11-29 09:41:40
【问题描述】:

我正在尝试在我的 Apple M1 Silicon 上安装 python 3.10.0。

通过 asdf venv 管理器安装。 3.7.9 和 3.9.4 可以正常工作,但安装 3.10.0 会导致以下错误:

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 版本 3.22.0

Apple clang 版本 13.0.0 (clang-1300.0.29.3) 目标:x86_64-apple-darwin21.1.0 线程模型:posix 安装目录:/Library/Developer/CommandLineTools/usr/bin

我尝试了什么:

导出 ARCHFLAGS="-arch arm64"

以及来自

的所有建议

Can't install Python 3.10.0 with pyenv on MacOS

提前非常感谢你,这让我发疯了:-)

【问题讨论】:

  • 您找到解决方案了吗?
  • 很遗憾没有。但是 python 3.10.2 有效。所以这对我来说很好。

标签: python-3.x arm apple-m1


【解决方案1】:
  1. 首先安装gettext:
brew install gettext
  1. 然后导出标志:
export LDFLAGS="-L/opt/homebrew/lib"; export CPPFLAGS="-I/opt/homebrew/include"
  1. 最后安装python:
pyenv install 3.10.0

它对我有用。我在这里找到了https://github.com/pyenv/pyenv/issues/1877#issuecomment-962514298

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-11-18
    • 2020-06-20
    • 1970-01-01
    • 1970-01-01
    • 2021-04-22
    • 1970-01-01
    • 2015-07-11
    • 2016-12-09
    相关资源
    最近更新 更多