V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2019-12-03 10:56:02 +08:00 · 2853 次点击
    这是一个创建于 1598 天前的主题,其中的信息可能已经有所发展或是发生改变。
    本人前端,最近在学 python。

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

    然后想了解下 python 里面一般是用什么方式来同步第三方包的?
    11 条回复    2019-12-03 12:18:00 +08:00
    dongyulin353
        1
    dongyulin353  
       2019-12-03 10:58:23 +08:00
    pip
    bmos
        2
    bmos  
       2019-12-03 10:59:10 +08:00
    下载包:pip install package
    导出包列表:pip freeze > requirements.txt
    按照包列表安装包:pip install -r requirement.txt
    yxcoder
        3
    yxcoder  
    OP
       2019-12-03 11:05:11 +08:00
    @bmos 多谢,顺便问一下,python 里面针对当前项目所使用的包,有办法导出吗?
    Vegetable
        4
    Vegetable  
       2019-12-03 11:06:37 +08:00
    Les1ie
        5
    Les1ie  
       2019-12-03 11:08:33 +08:00
    我一般手写 requiremets.txt
    renmu
        6
    renmu  
       2019-12-03 11:09:32 +08:00 via Android
    用虚拟环境
    CY4suncheng
        7
    CY4suncheng  
       2019-12-03 11:17:41 +08:00
    之前用过 pipenv,但是遇到几次 lock 的时候卡了好久,现在还是用 requirements.txt 管理了
    bmos
        8
    bmos  
       2019-12-03 11:43:32 +08:00
    @yxcoder 第二个不就是导出项目使用的包?配合虚拟环境使用。
    Trim21
        9
    Trim21  
       2019-12-03 12:07:49 +08:00 via Android
    推荐 poetry,不推荐 pipenv
    inhzus
        10
    inhzus  
       2019-12-03 12:13:19 +08:00 via Android
    virtualenv + requirements
    qcts33
        11
    qcts33  
       2019-12-03 12:18:00 +08:00
    同推荐 poetry,至少我自己用得比较顺手
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1234 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 23:27 · PVG 07:27 · LAX 16:27 · JFK 19:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.