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
SimbaPeng
V2EX  ›  Python

pipenv 怎么写 lock 文件怎么这么慢?每次 install 都要卡在 Locking [packages] dependencies…这里好久

  •  
  •   SimbaPeng · Mar 5, 2018 · 12828 views
    This topic created in 2978 days ago, the information mentioned may be changed or developed.
    14 replies    2021-01-31 12:17:41 +08:00
    ifoolish
        1
    ifoolish  
       Mar 5, 2018
    换个国内 pypi 源试试?
    SimbaPeng
        2
    SimbaPeng  
    OP
       Mar 5, 2018
    @ifoolish 换了,下载速度没问题,就是写 lock 文件慢
    Kirikora
        3
    Kirikora  
       Mar 5, 2018 via Android
    一样,我也有点奇怪。
    前两天还第一次遇到了 pipenv 的 bug,明明是兼容的依赖硬说不兼容(
    vimiix
        4
    vimiix  
       Mar 7, 2018
    大佬,解决了没,我也是一直卡着不动
    vimiix
        5
    vimiix  
       Mar 9, 2018
    我这边的原因是默认的 Pipfile 中 source 源是 python 官网。服务器在国外很慢。
    将 url 修改为清华的 pypi 源 https://pypi.tuna.tsinghua.edu.cn/simple 就好了
    hustlibraco
        6
    hustlibraco  
       May 4, 2018
    这个问题现在还没修复,写 Lock 文件超级慢
    环境:CentOS Linux release 7.3.1611 (Core) ,Python-2.7.5 , pipenv, version 11.10.1
    junezk
        7
    junezk  
       May 23, 2018
    我也这样,包安装完成后,写 Lock 文件需要 3 分钟以上。
    yili1992
        8
    yili1992  
       Jul 20, 2018
    我 install 一直报错 pipenv.patched.notpip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
    noahsss
        9
    noahsss  
       Oct 24, 2018
    曾经遇到一次 lock 了 28 分钟,总共才安装十几个包
    SimbaPeng
        10
    SimbaPeng  
    OP
       Oct 24, 2018
    @noahsss 我已经弃用了
    stebest
        11
    stebest  
       Jan 7, 2019
    @SimbaPeng 我也好慢,一直 lock,你最后换了啥
    ghostcode
        12
    ghostcode  
       Dec 19, 2019
    换了源,快很多。

      阿里云 https://mirrors.aliyun.com/pypi/simple/
      中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
      豆瓣(douban) http://pypi.douban.com/simple/
      清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
      中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
    catroll
        13
    catroll  
       Jan 31, 2021
    没说到点子上,其实这个和 Python 打包机制有关,主要是 PyPI 的问题,没有提供一个好用的包信息管理方式。
    lock 时,pipenv 需要对所有涉及的包逐个下载、解压、分析,当然慢
    我怀疑他可能会将一个包同一个版本的所有包文件( whl,zip 等)都下下来分析
    PyPI 正在重构,pip search 都用不了。
    说不定今后会改成 yum / apt 那种缓存包信息到本地的方式。
    期待吧
    catroll
        14
    catroll  
       Jan 31, 2021
    可以 --skip-lock 跳过,不生成 Pipenv.lock
    挺好的,没啥问题,不过唯一的缺点就是,不能生成 requirements.txt 了
    pipenv lock -r > requirements.txt && pipenv lock --dev -r > requirements-dev.txt
    我相信应该在今年解决这个问题了吧
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5748 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 78ms · UTC 06:26 · PVG 14:26 · LAX 23:26 · JFK 02:26
    ♥ Do have faith in what you're doing.