iT邦幫忙

0

Django #1-3 套件管理工具pip pipenv poetry

joor 2021-06-08 00:14:491282 瀏覽
  • 分享至 

  • xImage
  •  

1. pip

Python 原生套件管理工具

  1. venv 虛擬環境

    • install
    python -m venv D:\...\python -m venv
    
    • activate
    venv-name\Scripts\activate
    
    • deactivate
    deactivate
    
    • Unix 或 MacOS
    python -m venv
    source /.../venv-name/bin/activate 
    (venv-name) ~$
    
  2. 套件清單 requirements.txt

    freeza 匯出

    pip freeze > requirements.txt
    

2. pipenv

pip+virtualenv 兩款工具的合體

install

pip install pipenv
  1. venv 虛擬環境
    • install
    mkdir .venv && pipenv install requests --python 3.9
    
    • activate
    pipenv shell
    
    • deactivate
    exit
    
  2. 套件清單
    自動產生與更新Pipfile & Pipfile.lock

3. poetry (還未測試)

install

curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
  1. venv 虛擬環境

  2. 套件清單
    pyproject.toml


圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 則留言

我要留言

立即登入留言