2

When I am using this command to install Python in macOS Monterey 12.3:

v=3.8.13;wget http://npm.taobao.org/mirrors/python/$v/Python-$v.tar.xz -P ~/.pyenv/cache/;pyenv install $v

shows error like this:

--2022-05-12 23:06:11--  http://npm.taobao.org/mirrors/python/3.8.13/Python-3.8.13.tar.xz
Resolving npm.taobao.org (npm.taobao.org)... 114.55.80.225
Connecting to npm.taobao.org (npm.taobao.org)|114.55.80.225|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://cdn.npmmirror.com/binaries/python/3.8.13/Python-3.8.13.tar.xz [following]
--2022-05-12 23:06:11--  https://cdn.npmmirror.com/binaries/python/3.8.13/Python-3.8.13.tar.xz
Resolving cdn.npmmirror.com (cdn.npmmirror.com)... 120.220.77.238, 120.220.77.244, 120.220.77.248, ...
Connecting to cdn.npmmirror.com (cdn.npmmirror.com)|120.220.77.238|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 19023016 (18M) [application/x-xz]
Saving to: ‘/Users/xiaoqiangjiang/.pyenv/cache/Python-3.8.13.tar.xz.1’

Python-3.8.13.tar.xz.1                         100%[=================================================================================================>]  18.14M  3.61MB/s    in 4.9s

2022-05-12 23:06:16 (3.71 MB/s) - ‘/Users/xiaoqiangjiang/.pyenv/cache/Python-3.8.13.tar.xz.1’ saved [19023016/19023016]

python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Installing Python-3.8.13...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

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

Inspect or clean up the working tree at /var/folders/1p/dz3r2rz55kd60_t8sgslkvvh0000gn/T/python-build.20220512230617.94398
Results logged to /var/folders/1p/dz3r2rz55kd60_t8sgslkvvh0000gn/T/python-build.20220512230617.94398.log

Last 10 log lines:
  "__PyRuntime", referenced from:
      _check_preinit_isolated_config in _testembed.o
  "__Py_Dealloc", referenced from:
      _test_open_code_hook in _testembed.o
      __audit_hook_run in _testembed.o
  "__Py_InitializeMain", referenced from:
      _test_init_main in _testembed.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Programs/_testembed] Error 1

is the Python 3.8 did not support the Apple Silicon M1 Chip? what should I do to fixed this problem? I have searched from internet and found that someone using flutter facing this problem, no one facing this problem when install python 3 using pyenv. I have already tried to install gcc:

brew install gcc

still did not fixed this problem. I also tried to install the gettext followed by this question: Cannot install python 3.10.0 on m1 Apple silicon - ld: symbol(s) not found for architecture x86_64. still did not fixed this problem.

spark
  • 663
  • 1
  • 5
  • 18
  • did you manage to solve this? I am having the same issue – saga56 Jun 27 '22 at 12:01
  • From github thread here https://github.com/pyenv/pyenv/issues/1877#issuecomment-1273912920 ``` I was in the same situation. To be able to install python, I have only removed gettext, openssl, readline, tcl-tk from /usr/local/Cellar. It depends of each cases. Maybe better to remove all... thanks. ``` – Belegnar Dec 17 '22 at 15:10

0 Answers0