如何让 python 包在 mac m1 上运行?

发布于 2025-01-17 04:07:02 字数 549 浏览 2 评论 0原文

我正在尝试使用 instapy 构建 instagram 机器人,但在使用 Mac M1 芯片时尝试导入 instapy 时出现以下错误。

ImportError: dlopen(/venv/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so, 0x0002): tried: '/venv/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/cygrpc.cpython-310-darwin.so' (no such file)

实际上,在获得 mac m1 后,我最近在使用 python 软件包方面遇到了困难。我似乎找不到任何关于如何让其中一些软件包工作的信息。

如何解决此问题并修复其他有问题的软件包?

I am playing around with building an instagram bot using instapy, but I am getting the following error when trying to import instapy when using a Mac M1 chip.

ImportError: dlopen(/venv/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so, 0x0002): tried: '/venv/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/cygrpc.cpython-310-darwin.so' (no such file)

I've actually been having a tough time with python packages recently after getting a mac m1. I can't seem to find anything on how to get some of these packages to work.

How can I resolve this issue and fix other packages that are having issues?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

神经暖 2025-01-24 04:07:02

Python2 随 MacOS 一起提供,因此 pip install x 可能指向 Python2。请尝试以下操作:

pip3.10 install instapy

Python2 comes with MacOS, so pip install x may point towards Python2. Try the following:

pip3.10 install instapy
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文