MacOS python3.9 安装失败

pip install pyhanlp
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting pyhanlp
Using cached pyhanlp-0.1.66-py2.py3-none-any.whl
Collecting jpype1==0.7.0
Using cached https://mirrors.aliyun.com/pypi/packages/28/63/784834e8a24ec2e1ad7f703c3dc6c6fb372a77cc68a2fdff916e18a4449e/JPype1-0.7.0.tar.gz (470 kB)
Building wheels for collected packages: jpype1
Building wheel for jpype1 (setup.py) … error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python@3.9/bin/python3.9 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/private/var/folders/cz/yx1x1hrx5y71w6qphcgdg_lh0000gn/T/pip-install-dikq0443/jpype1_b34b8da3ecb546cfa9d30b04b27497e7/setup.py’"’"’; file=’"’"’/private/var/folders/cz/yx1x1hrx5y71w6qphcgdg_lh0000gn/T/pip-install-dikq0443/jpype1_b34b8da3ecb546cfa9d30b04b27497e7/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ bdist_wheel -d /private/var/folders/cz/yx1x1hrx5y71w6qphcgdg_lh0000gn/T/pip-wheel-o1q5vams
cwd: /private/var/folders/cz/yx1x1hrx5y71w6qphcgdg_lh0000gn/T/pip-install-dikq0443/jpype1_b34b8da3ecb546cfa9d30b04b27497e7/
Complete output (93 lines):
Found native jni.h at /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/include
/usr/local/Cellar/python@3.9/3.9.2_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py:274: UserWarning: Unknown distribution option: ‘use_scm_version’
warnings.warn(msg)

AttributeError: ‘array.array’ object has no attribute ‘fromstring’

ERROR: Failed building wheel for jpype1
Running setup.py clean for jpype1
Failed to build jpype1
Installing collected packages: jpype1, pyhanlp
Running setup.py install for jpype1 … error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python@3.9/bin/python3.9 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/private/var/folders/cz/yx1x1hrx5y71w6qphcgdg_lh0000gn/T/pip-install-dikq0443/jpype1_b34b8da3ecb546cfa9d30b04b27497e7/setup.py’"’"’; file=’"’"’/private/var/folders/cz/yx1x1hrx5y71w6qphcgdg_lh0000gn/T/pip-install-dikq0443/jpype1_b34b8da3ecb546cfa9d30b04b27497e7/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record /private/var/folders/cz/yx1x1hrx5y71w6qphcgdg_lh0000gn/T/pip-record-_klpqhnf/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/jpype1
cwd: /private/var/folders/cz/yx1x1hrx5y71w6qphcgdg_lh0000gn/T/pip-install-dikq0443/jpype1_b34b8da3ecb546cfa9d30b04b27497e7/
Complete output (90 lines):
Found native jni.h at /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/include
/usr/local/Cellar/python@3.9/3.9.2_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py:274: UserWarning: Unknown distribution option: ‘use_scm_version’
warnings.warn(msg)

AttributeError: ‘array.array’ object has no attribute ‘fromstring’
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python@3.9/bin/python3.9 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/private/var/folders/cz/yx1x1hrx5y71w6qphcgdg_lh0000gn/T/pip-install-dikq0443/jpype1_b34b8da3ecb546cfa9d30b04b27497e7/setup.py’"’"’; file=’"’"’/private/var/folders/cz/yx1x1hrx5y71w6qphcgdg_lh0000gn/T/pip-install-dikq0443/jpype1_b34b8da3ecb546cfa9d30b04b27497e7/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record /private/var/folders/cz/yx1x1hrx5y71w6qphcgdg_lh0000gn/T/pip-record-_klpqhnf/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/jpype1 Check the logs for full command output.
(base)

仅支持 Python<=3.8

conda install -c conda-forge openjdk python=3.8 jpype1=0.7.0 -y
pip install pyhanlp