Python/Jupyter 无法识别 cpython-39-darwin.so 文件
我试图导入以 cpython-39-darwin.so
结尾的模块,但 python 无法识别它们。当我删除 cpython-39-darwin
并只保留 .so
时,我的程序可以识别它们,但随后会引发有关“不兼容架构”的错误。我在尝试导入 open3d 时注意到这个问题,但其他库也会发生这种情况。
我有一台新的 MacBook (M1 Pro),我想知道这是否与该问题有关。
导入 open3d
ModuleNotFoundError Traceback(最近一次调用最后)
输入[26],<单元格行:1>()
<代码>----> 1导入open3d
文件~/opt/anaconda3/lib/python3.9/site-packages/open3d/
init
.py:90,在
84 warnings.warn(
85 "Open3D 是使用 CUDA 支持构建的,但 Open3D CUDA Python “
86“未找到绑定库!回退到CPU Python”
87“绑定库。”,ImportWarning)
89 if
DEVICE_API
== 'cpu':
---> 90 from open3d.cpu.pybind import (camera, data, Geometry, io, pipelines,
91 utility, t)
92 from open3d.cpu import pybind
< code> 94 import open3d.core
ModuleNotFoundError:没有名为 'open3d.cpu.pybind' 的模块
文件本身位于/open3d/cpu/pybind.cpython-39-darwin.so
。当我将其更改为 /open3d/cpu/pybind.so
时,它会识别该文件,但现在我收到以下错误:
ImportError
...
(mach-o 文件,但是是一个不兼容的架构(有 'x86_64',需要 'arm64e')), '/usr/local/lib/pybind.so' (没有这样的文件), '/usr/lib/pybind.so'(没有这样的文件)
I'm trying to import modules ending in cpython-39-darwin.so
and python doesn't recognize them. When I remove cpython-39-darwin
and just leave .so
, my program can recognize them, but then it raises an error about 'incompatible architecture'. I noticed this issue when trying to import open3d, but it's happening with other libraries too.
I have a new MacBook (M1 Pro) and I'm wondering if this has anything to do with the issue.
import open3d
ModuleNotFoundError Traceback (most recent call last)
Input In [26], in <cell line: 1>()
----> 1 import open3d
File ~/opt/anaconda3/lib/python3.9/site-packages/open3d/
init
.py:90, in <module>
84 warnings.warn(
85 "Open3D was built with CUDA support, but Open3D CUDA Python "
86 "binding library not found! Falling back to the CPU Python "
87 "binding library.", ImportWarning)
89 if
DEVICE_API
== 'cpu':
---> 90 from open3d.cpu.pybind import (camera, data, geometry, io, pipelines,
91 utility, t)
92 from open3d.cpu import pybind
94 import open3d.core
ModuleNotFoundError: No module named 'open3d.cpu.pybind'
The file itself is in /open3d/cpu/pybind.cpython-39-darwin.so
. When I change it to /open3d/cpu/pybind.so
, it recognizes the file, but now I get the following error:
ImportError
...
(mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/pybind.so' (no such file), '/usr/lib/pybind.so' (no such file)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论