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

pipenv install --ignore-pipfile 的实际意义

  •  
  •   ricolxwz · 171 天前 · 1151 次点击
    这是一个创建于 171 天前的主题,其中的信息可能已经有所发展或是发生改变。

    pipenv install --ignore-pipfile 是不是和 pipenv install 没有任何区别? 因为 pipenv install = pipenv lock + pipenv sync, 所以无论有没有加--ignore-pipfile, 都会更新 Pipfile.lock 然后从 Pipfile.lock 安装. 如果想要真的忽略 Pipfile, 为什么不直接用 pipenv sync?

    第 1 条附言  ·  171 天前

    For example:

    # Pipfile
    [[source]]
    url = "https://pypi.org/simple"
    verify_ssl = true
    name = "pypi"
    
    [packages]
    "requests" = "==2.11.0"
    
    [dev-packages]
    
    [requires]
    python_version = "3.12"
    
    # Pipfile.lock
    {
        "_meta": {
            "hash": {
                "sha256": "7f1be087f2e6adbe8ec64f71bfaaed8b6bb1595f3769488039b14c9d2e555dca"
            },
            "pipfile-spec": 6,
            "requires": {
                "python_version": "3.12"
            },
            "sources": [
                {
                    "name": "pypi",
                    "url": "https://pypi.org/simple",
                    "verify_ssl": true
                }
            ]
        },
        "default": {
            "requests": {
                "hashes": [
                    "sha256:09bc1b5f3a56cd8c48d433213a8cba51a67d12936568f73b5f1793fcb0c0979e",
                    "sha256:63f1815788157130cee16a933b2ee184038e975f0017306d723ac326b5525b54"
                ],
                "index": "pypi",
                "markers": "python_version >= '3.8'",
                "version": "==2.10.0"
            }
        },
        "develop": {}
    }
    
    第 2 条附言  ·  171 天前

    If I run pipenv install:

    $ pipenv install
    Pipfile.lock (555dca) out of date: run `pipfile lock` to update to (14165b)...
    Running $ pipenv lock then $ pipenv sync.
    Locking [packages] dependencies...
    Building requirements...
    Resolving dependencies...
    ✔ Success!
    Locking [dev-packages] dependencies...
    Updated Pipfile.lock (793cf11c853344d4cc8f42ede41e771eb6afaccce2510f7daf1efb578d14165b)!
    Installing dependencies from Pipfile.lock (14165b)...
    All dependencies are now up-to-date!
    Installing dependencies from Pipfile.lock (14165b)...
    

    If I run pipenv install --ignore-pipfile:

    $ pipenv install --ignore-pipfile
    Pipfile.lock (555dca) out of date: run `pipfile lock` to update to (14165b)...
    Running $ pipenv lock then $ pipenv sync.
    Locking [packages] dependencies...
    Building requirements...
    Resolving dependencies...
    ✔ Success!
    Locking [dev-packages] dependencies...
    Updated Pipfile.lock (793cf11c853344d4cc8f42ede41e771eb6afaccce2510f7daf1efb578d14165b)!
    Installing dependencies from Pipfile.lock (14165b)...
    All dependencies are now up-to-date!
    Installing dependencies from Pipfile.lock (14165b)...
    

    No difference at all.

    If I run pipenv sync:

    $ pipenv sync
    Installing dependencies from Pipfile.lock (555dca)...
    All dependencies are now up-to-date!
    
    1 条回复    2024-07-06 13:15:55 +08:00
    0o0O0o0O0o
        1
    0o0O0o0O0o  
       171 天前
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1046 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 19ms · UTC 19:38 · PVG 03:38 · LAX 11:38 · JFK 14:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.