V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
yxcoder
V2EX  ›  Python

Python 第三方包同步机制是什么

  •  
  •   yxcoder · Dec 3, 2019 · 3612 views
    This topic created in 2341 days ago, the information mentioned may be changed or developed.
    本人前端,最近在学 python。

    nodejs 里面是用 package.json,npm install 就可以下载所有 save 的第三方包了。

    然后想了解下 python 里面一般是用什么方式来同步第三方包的?
    11 replies    2019-12-03 12:18:00 +08:00
    dongyulin353
        1
    dongyulin353  
       Dec 3, 2019
    pip
    bmos
        2
    bmos  
       Dec 3, 2019
    下载包:pip install package
    导出包列表:pip freeze > requirements.txt
    按照包列表安装包:pip install -r requirement.txt
    yxcoder
        3
    yxcoder  
    OP
       Dec 3, 2019
    @bmos 多谢,顺便问一下,python 里面针对当前项目所使用的包,有办法导出吗?
    Les1ie
        5
    Les1ie  
       Dec 3, 2019
    我一般手写 requiremets.txt
    renmu
        6
    renmu  
       Dec 3, 2019 via Android
    用虚拟环境
    Clay0620
        7
    Clay0620  
       Dec 3, 2019
    之前用过 pipenv,但是遇到几次 lock 的时候卡了好久,现在还是用 requirements.txt 管理了
    bmos
        8
    bmos  
       Dec 3, 2019
    @yxcoder 第二个不就是导出项目使用的包?配合虚拟环境使用。
    Trim21
        9
    Trim21  
       Dec 3, 2019 via Android
    推荐 poetry,不推荐 pipenv
    inhzus
        10
    inhzus  
       Dec 3, 2019 via Android
    virtualenv + requirements
    qcts33
        11
    qcts33  
       Dec 3, 2019
    同推荐 poetry,至少我自己用得比较顺手
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2480 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 04:00 · PVG 12:00 · LAX 21:00 · JFK 00:00
    ♥ Do have faith in what you're doing.