繁体   English   中英

无法在带有 M1 芯片的 MAC 上运行 Aerospike python 客户端

[英]Unable to run Aerospike python client on MAC with M1 chip

您好,我正在尝试设置本地开发环境。 我已经安装了 aerospike==5.0.0。 但由于不支持 x86_64 架构,我无法导入它。

In [1]: import aerospike
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-d60dd2d8373f> in <module>
----> 1 import aerospike

ImportError: dlopen(/Users/mudit/.virtualenvs/payments/lib/python3.9/site-packages/aerospike.cpython-39-darwin.so, 0x0002): tried: '/Users/mudit/.virtualenvs/payments/lib/python3.9/site-packages/aerospike.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/aerospike.cpython-39-darwin.so' (no such file), '/usr/lib/aerospike.cpython-39-darwin.so' (no such file)

如果我将 python 版本降级到 3.7,我将无法安装 aerospike,出现以下错误:

pip install aerospike==5.0.0

Collecting aerospike==5.0.0
  Using cached aerospike-5.0.0.tar.gz (182 kB)
    ERROR: Command errored out with exit status 1:
     command: /Users/mudit/.pyenv/versions/3.7.10/envs/myenv/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/d3/p7j4w0dx1d56h05_2pwpf4q80000gp/T/pip-install-c0ra2cak/aerospike/setup.py'"'"'; __file__='"'"'/private/var/folders/d3/p7j4w0dx1d56h05_2pwpf4q80000gp/T/pip-install-c0ra2cak/aerospike/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/d3/p7j4w0dx1d56h05_2pwpf4q80000gp/T/pip-pip-egg-info-zqg4d0y6
         cwd: /private/var/folders/d3/p7j4w0dx1d56h05_2pwpf4q80000gp/T/pip-install-c0ra2cak/aerospike/
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Users/mudit/.pyenv/versions/3.7.10/envs/myenv/lib/python3.7/site-packages/setuptools/__init__.py", line 19, in <module>
        from setuptools.dist import Distribution
      File "/Users/mudit/.pyenv/versions/3.7.10/envs/myenv/lib/python3.7/site-packages/setuptools/dist.py", line 34, in <module>
        from setuptools import windows_support
      File "/Users/mudit/.pyenv/versions/3.7.10/envs/myenv/lib/python3.7/site-packages/setuptools/windows_support.py", line 2, in <module>
        import ctypes
      File "/Users/mudit/.pyenv/versions/3.7.10/lib/python3.7/ctypes/__init__.py", line 7, in <module>
        from _ctypes import Union, Structure, Array
    ModuleNotFoundError: No module named '_ctypes'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我什至尝试在 docker 上运行我的项目,但 aerospike 安装仍然失败。

12 4.293     info: Executing ./scripts/aerospike-client-c.sh
#12 4.293     info: downloading 'https://artifacts.aerospike.com/aerospike-client-c/5.2.0/aerospike-client-c-devel-5.2.0.debian11.x86_64.deb' to '/tmp/pip-install-ydkcep01/aerospike/aerospike-client-c/package/aerospike-client-c-devel-5.2.0.debian11.x86_64.deb'
#12 4.293       % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
#12 4.293                                      Dload  Upload   Total   Spent    Left  Speed
    100  2163  100  2163    0     0   3814      0 --:--:-- --:--:-- --:--:--  3814
#12 4.293     info: extracting files from 'aerospike-client-c-devel-5.2.0.debian11.x86_64.deb'
#12 4.293     dpkg-deb: error: 'aerospike-client-c-devel-5.2.0.debian11.x86_64.deb' is not a Debian format archive
#12 4.293
#12 4.293     CHECK
#12 4.293        [✗] /tmp/pip-install-ydkcep01/aerospike/aerospike-client-c/package/usr/lib/libaerospike.a
#12 4.293        [✗] /tmp/pip-install-ydkcep01/aerospike/aerospike-client-c/package/usr/include/aerospike/aerospike.h
#12 4.293
#12 4.293     error: scripts/aerospike-client-c.sh 1

有人可以建议使用 M1 芯片在 MacOs Monterey 上成功导入 aerospike python 客户端的方法吗?

如果您使用 KubeLab,则可以在 Apple M1 处理器上运行 Intel (x86_64, amd64) Docker 图像。 https://github.com/aerospike-community/docker-amd64-mac-m1

有关于如何使用它运行 Aerospike 服务器映像的说明。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM