我正在尝试按照以下说明在我的 M1 MacBook Air 上安装 Rasa。 https://forum.rasa.com/t/an-unofficial-guide-to-installing-rasa-on-an-m1-macbook /51342
但是,当我执行此代码时:
conda env create -v --name rasatest -f env.yml
我遇到此错误:
raise CondaEnvException("Pip failed")
conda.exceptions.CondaEnvException: Pip failed
我应该做什么?
writing src/lxml.egg-info/PKG-INFO
writing dependency_links to src/lxml.egg-info/dependency_links.txt
writing requirements to src/lxml.egg-info/requires.txt
writing top-level names to src/lxml.egg-info/top_level.txt
reading manifest file 'src/lxml.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.txt'
adding license file 'LICENSES.txt'
writing manifest file 'src/lxml.egg-info/SOURCES.txt'
Copying src/lxml.egg-info to build/bdist.macosx-11.0-arm64/wheel/lxml-4.9.3-py3.8.egg-info
running install_scripts
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/private/var/folders/69/rz46t6cs19b9wqr3znsqf35m0000gn/T/pip-install-qd7eh6r0/lxml_37fd30cab9dc408fbbe560ae9225b13a/setup.py", line 207, in <module>
setup(
File "/Users/magnus/miniforge3/envs/rasaM1/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/Users/magnus/miniforge3/envs/rasaM1/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Users/magnus/miniforge3/envs/rasaM1/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/Users/magnus/miniforge3/envs/rasaM1/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/magnus/miniforge3/envs/rasaM1/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 328, in run
impl_tag, abi_tag, plat_tag = self.get_tag()
File "/Users/magnus/miniforge3/envs/rasaM1/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 278, in get_tag
assert tag in supported_tags, "would build wheel with unsupported tag {}".format(tag)
AssertionError: would build wheel with unsupported tag ('cp38', 'cp38', 'macosx_11_0_arm64')
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lxml
Running setup.py clean for lxml
Failed to build lxml
ERROR: Could not build wheels for lxml, which is required to install pyproject.toml-based projects
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
failed
Traceback (most recent call last):
File "/Users/magnus/miniforge3/lib/python3.10/site-packages/conda/exceptions.py", line 1124, in __call__
return func(*args, **kwargs)
File "/Users/magnus/miniforge3/lib/python3.10/site-packages/conda_env/cli/main.py", line 78, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/Users/magnus/miniforge3/lib/python3.10/site-packages/conda/notices/core.py", line 109, in wrapper
return func(*args, **kwargs)
File "/Users/magnus/miniforge3/lib/python3.10/site-packages/conda_env/cli/main_create.py", line 154, in execute
result[installer_type] = installer.install(prefix, pkg_specs, args, env)
File "/Users/magnus/miniforge3/lib/python3.10/site-packages/conda_env/installers/pip.py", line 69, in install
return _pip_install_via_requirements(*args, **kwargs)
File "/Users/magnus/miniforge3/lib/python3.10/site-packages/conda_env/installers/pip.py", line 52, in _pip_install_via_requirements
stdout, stderr = pip_subprocess(pip_cmd, prefix, cwd=pip_workdir)
File "/Users/magnus/miniforge3/lib/python3.10/site-packages/conda_env/pip_util.py", line 39, in pip_subprocess
raise CondaEnvException("Pip failed")
conda.exceptions.CondaEnvException: Pip failed
我也尝试过此视频教程 https:// www.youtube.com/watch?v=oXL_LqAY650
如果我按照Rasa官方网站上的说明安装Rasa。它不适用于错误:
zsh: illegal hardware instruction
看来问题出在
lxml
软件包安装在 Apple Silicon Mac 上。
lxml
需要一些特殊的依赖项才能在 M1 上构建。
可以尝试以下步骤来解决此问题:
1. 使用 Miniforge 安装
lxml
的预构建版本:
-
打开终端并确保处于
rasatest
环境中。 -
运行以下命令安装
lxml
:
conda install -c conda-forge lxml
这将从 conda-forge 频道安装针对 M1 芯片预构建的
lxml
版本。
2. 如果仍然遇到问题,请尝试以下操作:
- 更新 conda 和 pip:
conda update -n base -c defaults conda
conda update --all
- 创建新环境并再次尝试安装:
conda create -n rasa-env python=3.8
conda activate rasa-env
conda env update -f env.yml
-
确保的
env.yml
文件指定了正确的依赖项版本,并且与 Apple Silicon 兼容。
如果仍然遇到问题,请提供以下信息,以便我进一步帮助:
-
的完整
env.yml
文件内容。 - 正在使用的 Rasa 版本。
- 使用的 macOS 版本。