根据诗歌的 docs,设置新项目的正确方法是 with poetry new poetry-demo,但是这会通过创建以下 toml 文件创建基于现已弃用的 python2.7 的项目:
[tool.poetry]
name = "poetry-demo"
version = "0.1.0"
description = ""
authors = ["Harsha Goli <harshagoli@gmail.com>"]
[tool.poetry.dependencies]
python = "^2.7"
[tool.poetry.dev-dependencies]
pytest = "^4.6"
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
Run Code Online (Sandbox Code Playgroud)
如何将其更新到 3.7?简单地更改python = "^2.7"为python = "^3.7"在poetry install运行时会导致以下错误:
[SolverProblemError]
The current project's Python requirement (2.7.17) is not compatible with some of the required packages Python requirement:
- zipp requires Python >=3.6
Because …Run Code Online (Sandbox Code Playgroud) 我有一个 pyproject.toml:
...
[[tool.poetry.source]]
name = "REPO_NAME"
url = "https://gitlab.com/SOME_ADDRESS"
secondary = true
Run Code Online (Sandbox Code Playgroud)
poetry install当尝试使用诗歌( / )安装项目时,poetry update我得到:
更新依赖关系 解决依赖关系... (14.3s)
重定向过多
超过 30 次重定向。
我尝试将我的诗歌从 1.1.x 版本升级到 1.3,但官方手册(https://python-poetry.org/docs/)建议我手动删除旧版本。不幸的是,我可能删除了错误的文件,因为安装 1.3 版本后,我仍然收到错误,这些错误似乎与旧诗歌相冲突。 \n我试图找到我帐户中的所有文件(它是远程计算机,所以我不想影响其他人)以某种方式与诗歌(与find /home/username -name *poetry*)有联系并且(卸载诗歌1.3后)删除了它们。然后我重新安装了诗歌 1.3,但仍然无法正常工作。\n还尝试删除我的整个存储库并再次克隆它,但仍然存在同样的问题。我想我已经很生气了,但希望有某种方法可以进行硬重置。有什么办法可以摆脱这个吗?
这是我的错误消息的开头:
\n\nPackage operations: 28 installs, 0 updates, 0 removals\n\n \xe2\x80\xa2 Installing certifi (2021.10.8)\n \xe2\x80\xa2 Installing charset-normalizer (2.0.12)\n \xe2\x80\xa2 Installing idna (3.3)\n \xe2\x80\xa2 Installing six (1.16.0)\n \xe2\x80\xa2 Installing typing-extensions (4.2.0)\n \xe2\x80\xa2 Installing urllib3 (1.26.9)\n\n DBusErrorResponse\n\n [org.freedesktop.DBus.Error.UnknownMethod] (\'No such interface \xe2\x80\x9corg.freedesktop.DBus.Properties\xe2\x80\x9d on object at path /org/freedesktop/secrets/collection/login\',)\n\n at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/secretstorage/util.py:48 in send_and_get_reply\n 44\xe2\x94\x82 def send_and_get_reply(self, msg: Message) -> Any:\n 45\xe2\x94\x82 try:\n 46\xe2\x94\x82 resp_msg: Message = self._connection.send_and_get_reply(msg)\n 47\xe2\x94\x82 …Run Code Online (Sandbox Code Playgroud)