deepwzh的技术笔记
  • Golang
  • Python
  • Cpp
杂项
前端开发
  • 计算机网络
  • 操作系统
  • 数据库
云原生
Devops
AIGC
关于作者
  • Golang
  • Python
  • Cpp
杂项
前端开发
  • 计算机网络
  • 操作系统
  • 数据库
云原生
Devops
AIGC
关于作者
  • Python
  • 魔术方法
  • pep 草案
  • 内存管理
  • 学习资料

    • 学习资料
    • 进阶学习资料
  • Asyncio

    • Asyncio
    • 调度
  • 库

    • 库
    • 模板渲染相关
    • protobuf 相关
    • mysql 相关
  • cpython开发

    • cpython 开发
    • 开发环境搭建
    • CAPI
    • 提交流程
    • Pyrepl
  • 包与虚拟环境管理器

    • 包与虚拟环境管理器
    • Pip
    • Conda
    • Poetry
    • Pyenv
  • 科学计算相关

    • 科学计算相关
    • Pandas

Poetry

安装

配置

poetry completions bash >> ~/.bash_completion
source ~/.bashrc

poetry env list

导出 requirements.txt

poetry export -f requirements.txt --output requirements.txt

通过 requirements 安装依赖

poetry add $( cat requirements.txt )
_# or_
cat requirements.txt | xargs poetry add

修改镜像源

poetry self add poetry-plugin-pypi-mirror

#豆瓣 https://pypi.doubanio.com/simple/
#网易 https://mirrors.163.com/pypi/simple/
#阿里云 https://mirrors.aliyun.com/pypi/simple/
#清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/

[[tool.poetry.source]]
name = "aliyun"
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
default = true

[plugins.pypi_mirror]
url = "https://pypi.tuna.tsinghua.edu.cn/simple/"

poetry 安装、升级和换源 - waketzheng - 博客园

将虚拟环境创建在当前目录,这样 vscode 可以识别

poetry config virtualenvs.in-project true
Prev
Conda
Next
Pyenv