报错信息如下:
C:\Users\q\Desktop\ai-rasa\rasa (main -> origin)
λ pip3 install rasa[full]
Collecting rasa[full]
Downloading rasa-1.10.2-py3-none-any.whl.metadata (14 kB)
Collecting PyJWT<1.8,>=1.7 (from rasa[full])
Downloading PyJWT-1.7.1-py2.py3-none-any.whl.metadata (3.9 kB)
Collecting SQLAlchemy<1.4.0,>=1.3.3 (from rasa[full])
Downloading SQLAlchemy-1.3.24.tar.gz (6.4 MB)
---------------------------------------- 6.4/6.4 MB 6.1 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Collecting absl-py<0.10,>=0.9 (from rasa[full])
Downloading absl-py-0.9.0.tar.gz (104 kB)
---------------------------------------- 104.0/104.0 kB 5.9 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
Traceback (most recent call last):
File "C:\Users\q\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Users\q\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\q\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\q\AppData\Local\Temp\pip-build-env-87gjb2eb\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\q\AppData\Local\Temp\pip-build-env-87gjb2eb\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "C:\Users\q\AppData\Local\Temp\pip-build-env-87gjb2eb\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
super().run_setup(setup_script=setup_script)
File "C:\Users\q\AppData\Local\Temp\pip-build-env-87gjb2eb\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 34, in <module>
RuntimeError: Python version 2.7 or 3.4+ is required.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel 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.
C:\Users\q\Desktop\ai-rasa\rasa (main -> origin)
λ ^C
C:\Users\q\Desktop\ai-rasa\rasa (main -> origin)
λ pip3 install rasa[full]
Collecting rasa[full]
Using cached rasa-1.10.2-py3-none-any.whl.metadata (14 kB)
Collecting PyJWT<1.8,>=1.7 (from rasa[full])
Using cached PyJWT-1.7.1-py2.py3-none-any.whl.metadata (3.9 kB)
Collecting SQLAlchemy<1.4.0,>=1.3.3 (from rasa[full])
Using cached SQLAlchemy-1.3.24.tar.gz (6.4 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Collecting absl-py<0.10,>=0.9 (from rasa[full])
Using cached absl-py-0.9.0.tar.gz (104 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
Traceback (most recent call last):
File "C:\Users\q\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Users\q\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\q\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\q\AppData\Local\Temp\pip-build-env-xvwturyu\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\q\AppData\Local\Temp\pip-build-env-xvwturyu\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "C:\Users\q\AppData\Local\Temp\pip-build-env-xvwturyu\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
super().run_setup(setup_script=setup_script)
File "C:\Users\q\AppData\Local\Temp\pip-build-env-xvwturyu\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 34, in <module>
RuntimeError: Python version 2.7 or 3.4+ is required.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel 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.
问题原因:
这个错误信息表明在尝试安装Rasa及其全功能依赖包(rasa[full]
)时,遇到了一个与Python版本兼容性相关的问题。错误信息中的关键部分是:
1RuntimeError: Python version 2.7 or 3.4+ is required.
虽然错误提示要求Python 2.7或3.4及以上版本,但实际上Rasa 1.10.2版本需要Python 3.6及以上版本。你遇到的错误可能是由于某个依赖项(在这里是absl-py)的构建过程中误报了Python版本需求,或者是在处理依赖时出现了混淆。
考虑到你可能正在使用的是Python 3.12(根据路径中的Python312
),这可能是某个软件包尚未正式支持该Python版本导致的问题。
解决方法:
-
确认Python版本:首先,确保你的Python环境是稳定的,并且是Rasa所支持的版本。Rasa官方文档通常会列出支持的Python版本。对于Rasa 1.10.x,推荐使用Python 3.6至3.9之间的版本。
-
使用兼容的Python版本:如果你当前使用的是Python 3.12,而它不是Rasa明确支持的版本,你可以考虑降级到一个受支持的Python版本,比如3.9。你可以使用工具如Anaconda来管理多个Python环境,以避免版本冲突。
-
虚拟环境:在进行安装之前,建议使用虚拟环境(如venv或conda环境),这样可以隔离项目依赖,避免影响系统全局的Python环境。
-
重新尝试安装:在设置了合适的Python环境后,再次尝试使用
pip3 install rasa[full]
命令安装。 -
直接安装特定版本:如果问题依旧,尝试直接指定安装Rasa的一个稳定版本,比如Rasa 2.x系列,它可能已经修复了与新Python版本的兼容性问题(但请先检查Rasa的官方文档确认版本兼容性)。
-
查看Rasa官方文档:访问Rasa的官方文档页面,查看最新的安装指南和系统要求,以获取最准确的安装指导。
如果上述步骤仍然不能解决问题,考虑查看Rasa的GitHub仓库是否有相关issue报告,或者在Rasa的社区论坛寻求帮助,那里可能会有遇到类似问题的用户或维护者能提供更具体的解决方案。