sudo apt install pipx
pipx install poetry
(llamaindex-39) gw00241401@gw00241401-pc:/data2/05_llamaindex/llama_index$ pipx install poetry
installed package poetry 1.7.1, installed using Python 3.11.4
These apps are now globally available
- poetry
⚠️ Note: '/home/gw00241401/.local/bin' is not on your PATH environment variable. These apps will not be globally accessible until your PATH is updated. Run `pipx ensurepath` to
automatically add it, or manually modify your PATH in your shell's config file (i.e. ~/.bashrc).
done! ✨ 🌟 ✨
poetry -V
The Poetry configuration is invalid
- [source.0] Additional properties are not allowed ('priority' was unexpected)
版本有问题,比较低,可能是安装的poetry的路径,被系统默认的poetry给接胡了。
我发现用pipx list 查看,poetry 版本是1.7;但是poetry -V ,版本是1.3
whereis poetry
#output : /usr/bin/poetry
#将其文件删除或改名;
rm /usr/bin/poetry
#重新安装poetry
pipx uninstall poetry
pipx install poetry
poetry -V
#这时,显示版本是1.7
设置poetry 源:
[[tool.poetry.source]]
name = "ali"
url = "https://mirrors.aliyun.com/pypi/simple/"
priority = "primary"
[[tool.poetry.source]]
name = "tencent"
url = "https://mirrors.cloud.tencent.com/pypi/simple/"
priority = "primary"
[[tool.poetry.source]]
name = "tsinghua"
url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/"
priority = "default"
参考: