对于 python 3.8.8 并使用新的 mac air(带有 m1 芯片),在 jupyter 笔记本和 python 终端中,import jax
引发此错误
Python 3.8.8 (default, Apr 13 2021, 12:59:45)
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import jax
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/steve/Documents/code/jax/jax/__init__.py", line 37, in <module>
from . import config as _config_module
File "/Users/steve/Documents/code/jax/jax/config.py", line 18, in <module>
from jax._src.config import config
File "/Users/steve/Documents/code/jax/jax/_src/config.py", line 26, in <module>
from jax import lib
File "/Users/steve/Documents/code/jax/jax/lib/__init__.py", line 63, in <module>
cpu_feature_guard.check_cpu_features()
RuntimeError: This version of jaxlib was built using AVX instructions, which your CPU and/or operating system do not support. You may be able work around this issue by building jaxlib from source.
我怀疑这是因为 m1 芯片而发生的。
我尝试使用 jax 与pip install jax
,然后我按照评论的建议从源代码构建了它,通过克隆其存储库并按照给出的说明进行操作here,但显示相同的错误消息。
我有类似的问题。由于我已经安装了 Anaconda,并且不想用 Anaconda + miniconda + homebrew 版本的 python 和包管理等来弄乱我的空间,所以我四处寻找一个简单的解决方案。最终对我有用的是首先卸载jax
and jaxlib
然后安装jax
and jaxlib
直接通过 conda-forge:
pip uninstall jax jaxlib
conda install -c conda-forge jaxlib
conda install -c conda-forge jax
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)