推荐学习书目
› 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
chuanqirenwu
V2EX  ›  Python

Python pip 安装包时有没有类似于 npm 一样把新的依赖写入 requirements 的方法或者工具?

  •  
  •   chuanqirenwu · May 7, 2018 · 4617 views
    This topic created in 3119 days ago, the information mentioned may be changed or developed.
    pip freeze > requirements 会把所有相互依赖的包一股脑写到 requirements 文件,而一般开发都分 development、production、test 各种环境,每种环境依赖的包是不同的。
    14 replies  •  2018-05-08 01:21:39 +08:00
    tomczhen
    tomczhen
    May 7, 2018 via Android
    1
    pipenv
    secsilm
    secsilm
    May 7, 2018 via Android
    2
    @tomczhen pipenv 速度很慢
    crysislinux
    crysislinux
    May 7, 2018 via Android
    3
    为啥不同环境还要依赖不同的包。即使有也不会多,直接全装了。
    HelloAmadeus
    HelloAmadeus
    May 7, 2018 via Android❤️1
    4
    pip freeze
    chuanqirenwu
    chuanqirenwu
    OP
    May 7, 2018
    5
    @crysislinux 难道这就是后端和前端的区别么?
    shiroming
    shiroming
    May 7, 2018 via Android
    6
    pip-tools
    crysislinux
    crysislinux
    May 7, 2018 via Android
    7
    @chuanqirenwu 你这么一说确实想起以前 Ruby 的就可以分环境装。但是现在感觉为啥呢。装一样的环境不是更好?
    metamask
    metamask
    May 7, 2018
    8
    @secsilm

    [[source]]

    url = "https://pypi.doubanio.com/simple"
    verify_ssl = true
    name = "douban"
    Sylv
    Sylv
    May 7, 2018 via iPhone
    9
    pipenv
    secsilm
    secsilm
    May 7, 2018 via Android
    10
    @freakxx 不好意思没表述清楚,我说的是在更新 lock file 阶段速度很慢
    guoweikuang
    guoweikuang
    May 7, 2018
    11
    @secsilm 同感,更新 lock file 太慢了
    enrolls
    enrolls
    May 7, 2018
    12
    [github]( https://github.com/bndr/pipreqs) 这个不能满足需求?
    h404bi
    h404bi
    May 7, 2018❤️1
    13
    pipenv lock 时真的很慢,装某些包时可能卡会几分钟到十几分钟。。
    也有不少反馈,目前好像还没解决: https://github.com/pypa/pipenv/issues/1785
    所以现在写入 Pipfile 时只好先跳过 lock ( pipenv install --skip-lock )...
    tonyaiken
    tonyaiken
    May 8, 2018
    14
    @crysislinux 比如有些依赖是辅助 debug 的,production 用不上
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1051 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 18:42 · PVG 02:42 · LAX 10:42 · JFK 13:42
    ♥ Do have faith in what you're doing.