如何从头开始重建诗歌环境并强制重新安装所有内容?
How to rebuild Poetry environment from scratch and force reinstall everything?
Poetry 有一些陈旧的依赖项,因为使用了 develop = true
包。 Poetry 无法自行判断依赖项是否已更新。我如何强制 Poetry 重新安装其 virtualenv 中的所有内容以解决此问题?
这些说明仅适用于 Linux/macOS 的 Windows 子系统 Linux。对于 Microsoft Windows shell,请使用您自己的命令行知识来应用这些说明。
重建诗歌环境
在 pyproject.toml
的文件夹中执行以下操作:
# Stop the current virtualenv if active or alternative use
# `exit` to exit from a Poetry shell session
deactivate
# Remove all the files of the current environment of the folder we are in
rm -rf `poetry env info -p`
# Reactivate Poetry shell
poetry shell
# Install everything
poetry install
用不同的 Python 版本重新创建 Poetry 环境
诗歌可能是指你安装的Python版本,所以你可能会告诉它:
# Make Poetry to use python 3.9 from Homebrew, installed earlier
poetry env use `which python3.9`
poetry shell
python -V
Python 3.9.9
Kudos to this tip about removing the virtualenv.
修复损坏的诗歌命令
如果poetry
命令本身损坏不再运行,您可以通过以下方式重新安装Poetry:
which poetry
/Users/mikkoohtamaa/.poetry/bin/poetry
然后删除这个和install:
rm -rf /Users/mikkoohtamaa/.poetry
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -
Poetry 有一些陈旧的依赖项,因为使用了 develop = true
包。 Poetry 无法自行判断依赖项是否已更新。我如何强制 Poetry 重新安装其 virtualenv 中的所有内容以解决此问题?
这些说明仅适用于 Linux/macOS 的 Windows 子系统 Linux。对于 Microsoft Windows shell,请使用您自己的命令行知识来应用这些说明。
重建诗歌环境
在 pyproject.toml
的文件夹中执行以下操作:
# Stop the current virtualenv if active or alternative use
# `exit` to exit from a Poetry shell session
deactivate
# Remove all the files of the current environment of the folder we are in
rm -rf `poetry env info -p`
# Reactivate Poetry shell
poetry shell
# Install everything
poetry install
用不同的 Python 版本重新创建 Poetry 环境
诗歌可能是指你安装的Python版本,所以你可能会告诉它
# Make Poetry to use python 3.9 from Homebrew, installed earlier
poetry env use `which python3.9`
poetry shell
python -V
Python 3.9.9
Kudos to this tip about removing the virtualenv.
修复损坏的诗歌命令
如果poetry
命令本身损坏不再运行,您可以通过以下方式重新安装Poetry:
which poetry
/Users/mikkoohtamaa/.poetry/bin/poetry
然后删除这个和install:
rm -rf /Users/mikkoohtamaa/.poetry
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -