首页 > 编程问答 >我无法在 Mac M1 上安装 Rasa

我无法在 Mac M1 上安装 Rasa

时间:2024-07-21 00:13:04浏览次数:6  
标签:python tensorflow rasa rasa-nlu rasa-x

我正在尝试按照以下说明在我的 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 版本。

标签:python,tensorflow,rasa,rasa-nlu,rasa-x
From: 76742434

相关文章

  • 在 Raspberry Pi 4 上使用 Python 从具有 SPI 连接的 MT6816 磁性编码器读取
    我对这个领域完全陌生,并不真正知道自己在做什么并且需要帮助。我正在尝试使用MT681614位磁性编码器通过RaspberryPi的SPI连接读取绝对角度。我有以下问题:在硬件方面,是否只是简单地连接必要的连接(3.3V、MOSI、MISO、SCK、GND、CE01)?对于编码......
  • PythonW 不运行脚本。严重地
    因此,使用Windows10和Python3.6。我创建了一个.py脚本,它可以使用命令pythonmyscript.py在命令提示符下正常运行,但是当我制作该脚本的精确副本并为其赋予扩展名.pyw,并尝试使用pythonw运行它时命令pythonwmyscript.pyw,什么也没有发生......
  • 如何使用Python和Selenium模拟产品购买以获取库存信息
    我正在开发一项网络抓取服务,主要针对时尚行业。我的目标是提供有关产品的全面数据,包括库存水平。为了实现这一目标,我需要模拟购买以确定每种尺寸的产品的最大可用数量。我一直在使用Python和Selenium进行网络抓取部分,但在准确模拟购买方面面临着挑战检索股票信息的过程。......
  • 连接Python套接字的问题
    当我写“关闭”时,我试图让我的电报机器人关闭计算机。我不想将机器人连接到网站上的托管。我选择我的手机(AndroidRedmiNote10)作为托管。我在上面安装了Termux和Pydroid。我写了两个文件:main到我的电脑,client到我的手机。通过在计算机上运行这两个文件,一切正常。但是,当我在......
  • 如何修复导入 Numexpr Python 时的错误
    在Windows10Python3.7.9(IDLE)上,我成功安装了“pipinstallnumexpr”,但在“importnumexprasne”时出现错误:Traceback(最近一次调用):文件“<pyshell#21>”,第267行,位于将numexpr导入为ne文件“C:\Python379\lib\site-packages\numexpr_init_.py”......
  • 如何实现 Grad-CAM 在 TensorFlow ResNet152V2 上查看激活图/热图以进行图像分类
    您好,我正在使用ResNet152V2做一个关于TensorFlow图像分类的小项目。我编写了一个Train-Predict.py脚本,它能够训练trained_weights.hdf5文件以成功预测自闭症和非自闭症人士的图像。此处。是脚本:#ImportLibrariesimportosimportnumpyasnp......
  • 让 cpython 优化恒定条件
    我正在用Python编写需要尽可能高效运行的代码,但有时我需要深入挖掘调试语句。不要注释这些输入或输出(或者使用外部预处理器来处理代码,就像这里建议的那样Python相当于#ifdefDEBUG或这里如何在python中实现“#ifdef”?|||)我想在模块的开头定义一个变量......
  • 如何使用 for 循环在 python jupyter 笔记本中创建动态图?
    我正在学习本课关于用Python求解热方程。该课程指出,在求解热方程后,我们可以通过在循环中简单地调用pyplot.plot()来可视化解的动画图,其中下面的代码将动态绘制每次每个点的温度,从而得到一个动画情节(课程帖子中提供了动画情节的示例)。importnumpyfrommatplotlibi......
  • Python:动态爱心代码
    importrandomfrommathimportsin,cos,pi,logfromtkinterimport*CANVAS_WIDTH=640CANVAS_HEIGHT=480CANVAS_CENTER_X=CANVAS_WIDTH/2CANVAS_CENTER_Y=CANVAS_HEIGHT/2IMAGE_ENLARGE=11HEART_COLOR="#FF99CC"defcenter_......
  • 如何在 PYTHON 中查找输入数字的千位、百位、十位和个位中的数字?例如:256 有 6 个一、5
    num=int(input("Pleasegivemeanumber:"))print(num)thou=int((num//1000))print(thou)hun=int((num//100))print(hun)ten=int((num//10))print(ten)one=int((num//1))print(one)我尝试过这个,但它不起作用,我被困住了。代码几乎是正确的,但需......