python - numpy 无法在 Big Sur 11.4 上运行
问题描述
最近,我的 Python 安装中的 Numpy 停止工作。
我相信这可能是由于我的 Mac 升级到 Xcode 12.5.1(于 2021 年 6 月 23 日更新)引起的。
这是我得到的错误:
Python 3.9.5 (default, May 4 2021, 03:36:27)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/numpy/core/__init__.py", line 22, in <module>
from . import multiarray
File "/usr/local/lib/python3.9/site-packages/numpy/core/multiarray.py", line 12, in <module>
from . import overrides
File "/usr/local/lib/python3.9/site-packages/numpy/core/overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: dlopen(/usr/local/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so, 2): Symbol not found: ___addtf3
Referenced from: /usr/local/lib/python3.9/site-packages/numpy/core/../.dylibs/libquadmath.0.dylib
Expected in: /usr/lib/libSystem.B.dylib
in /usr/local/lib/python3.9/site-packages/numpy/core/../.dylibs/libquadmath.0.dylib
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/site-packages/numpy/__init__.py", line 150, in <module>
from . import core
File "/usr/local/lib/python3.9/site-packages/numpy/core/__init__.py", line 48, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from "/usr/local/opt/python@3.9/bin/python3.9"
* The NumPy version is: "1.21.0"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: dlopen(/usr/local/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so, 2): Symbol not found: ___addtf3
Referenced from: /usr/local/lib/python3.9/site-packages/numpy/core/../.dylibs/libquadmath.0.dylib
Expected in: /usr/lib/libSystem.B.dylib
in /usr/local/lib/python3.9/site-packages/numpy/core/../.dylibs/libquadmath.0.dylib
我的系统上不再有 /usr/lib/libSystem.B.dylib:
ls: /usr/lib/libSystem.B.dylib: No such file or directory
然而,这似乎是大苏尔的预期。到目前为止,我似乎是唯一一个受到 numpy 影响的人……这是为什么呢?
我尝试从 pip3(源和轮子)和 brew 重新安装 numpy,但结果始终相同。
这是我的系统:
ProductName: macOS
ProductVersion: 11.4
BuildVersion: 20F71
解决方案
我的类似错误已通过删除 Kite 得到修复。出于某种原因,应用程序在导入 numpy 时会导致问题。
推荐阅读
- matlab - 在matlab中使用ODE45函数求解不同初始条件值的非线性方程
- python - 如何在不同的文件夹中 rm .xml
- java - 使用 java11 HttpClient.sendAsync() 下载 zip 文件
- c++ - C ++我的复制构造函数无法将内存移动到新区域
- junit - 在 java 中模拟模型映射器严格策略
- python-sphinx - 使文档的标题级别自动依赖于它们所属的 (sub(sub(...))) 文件夹的深度级别
- reactjs - 反应:TypeError:无法读取 null 的属性“正文”
- android - 如何将屏幕上的任何小部件设置在特定位置并具有响应性
- scala - 在 scala 中使用可变参数创建 groupBy 函数
- excel - 将数据从第 n 列导入另一个工作表