Python 包管理工具 poetry(qbit)
文章目录
- 官方文档:https://python-poetry.org/docs/
poetry 查看配置项
poetry config --list修改缓存目录
poetry config cache-dir D:\pypoetry将虚拟目录放在项目内
poetry config virtualenvs.in-project true发现
pyenv等虚拟环境的 python 解释器poetry config virtualenvs.prefer-active-python true软件包国内镜像(pyproject.toml)
[[tool.poetry.source]] name = "aliyun" url = "https://mirrors.aliyun.com/pypi/simple/" default = true[[tool.poetry.source]] name = "douban" url = "https://pypi.doubanio.com/simple/" default = true指定特定平台(linux)的第三方包
[tool.poetry.dependencies] python = "~3.8.8" fastapi = { version = "~0.65.3", extras = ["all"] } gunicorn = { version = "~20.1.0", platform = "linux"}poetry 导出 requirements.txt
poetry export -f requirements.txt --output requirements.txt poetry export --without-hashes -f requirements.txt --output requirements.txt
本文出自 qbit snap
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论