Kam*_*ngh 6 python-poetry rasa
我正在按照以下链接在我的系统上安装 RASA:https : //github.com/RasaHQ/rasa 但不幸的是,在尝试安装依赖项或以下任何用 Makefile 编写的诗歌命令时,
$poetry run
$poetry install
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
虚拟环境设置似乎存在一些问题,但不知道如何解决。以下是堆栈跟踪:
$ make install
poetry run python -m pip install -U 'pip<20'
The virtual environment found in /home/kamaldeep/.cache/pypoetry/virtualenvs/rasa-LHgLSZoI-py3.6 seems to be broken.
Recreating virtualenv rasa-LHgLSZoI-py3.6 in /home/kamaldeep/.cache/pypoetry/virtualenvs/rasa-LHgLSZoI-py3.6
[CalledProcessError]
Command '['/home/kamaldeep/.cache/pypoetry/virtualenvs/rasa-LHgLSZoI-py3.6/bin/python', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
Makefile:43: recipe for target 'install' failed
make: *** [install] Error 1
Run Code Online (Sandbox Code Playgroud)
卡马尔迪普·辛格的回答正是我所需要的:sudo apt-get install python3.7-venv。(根据您的特定 Python 3.x 版本等进行调整)
需要添加一些细节来完成该过程(这适用于像我这样不太擅长处理包版本并且可能还不熟悉使用 Poetry 的人)(根据您想要使用的 Python 版本进行调整):
转到您的项目目录并启动 Poetry(如果您尚未在那里);摆脱破碎的虚拟环境,
cd your_project_directory
poetry shell
poetry env remove python3.7
Run Code Online (Sandbox Code Playgroud)
离开诗歌(我发现诗歌否则会变得混乱),
exit
Run Code Online (Sandbox Code Playgroud)
您已经python3.7-venv按照 Kamaldeep Singh 的回答安装了吗?如果没有,请立即执行(假设您使用的是基于 Debian/Ubuntu 的系统),
sudo apt install python3.7-venv
Run Code Online (Sandbox Code Playgroud)
重新进入诗歌,
poetry shell
Run Code Online (Sandbox Code Playgroud)
现在重新创建已安装的环境python3.7-venv,
poetry env use python3.7
Run Code Online (Sandbox Code Playgroud)
为您的项目添加所需的依赖项,
poetry install
Run Code Online (Sandbox Code Playgroud)
就是这样,您现在应该准备好在新的 Python 版本中处理您的项目了。Poetry CLI 文档提供更多选项...
(更新:有点奇怪:我发现退出并重新进入poetry shell一次对于被发现poetry install是必要的。这一离开诗歌并重新进入它的步骤(再次)感觉非常笨拙,也许这里有人可以解释为什么这可能评论里有必要吗?)pytest
如果您遇到虚拟环境损坏的错误,例如
The virtual environment found in /home/kamaldeep/.cache/pypoetry/virtualenvs/rasa-LHgLSZoI-py3.7 seems to be broken
Run Code Online (Sandbox Code Playgroud)
然后在各自的python包中安装venv,如python3.6、python3.5。就我而言,我使用的是 python 3.7
sudo apt-get install python3.7-venv
Run Code Online (Sandbox Code Playgroud)
另一种方法是禁用虚拟环境
poetry config virtualenvs.create false
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4024 次 |
| 最近记录: |