Skip to content

pipenv lock doesn't work after latest update #4527

Closed

Description

@J-M0

Issue description

When trying to lock the dependencies for my project, it fails with this error

pipenv.exceptions.DependencyConflict: ERROR: Cannot resolve conflicting version django<3.0,>=2.2.9 while django==3.1.3 is locked.

even though Django 3.1 is not used in the project

Expected result

pipenv lock to succeed

Actual result

$ pipenv lock --verbose
Locking [dev-packages] dependencies...
Building requirements...
Resolving dependencies...
⠋ Locking...
                          ROUND 1                           
✘ Locking Failed! 
Current constraints:
  django-debug-toolbar (from -r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))

Finding the best candidates:
  found candidate django-debug-toolbar==3.1.1 (constraint was <any>)

Finding secondary dependencies:
  django-debug-toolbar==3.1.1 requires django>=2.2, sqlparse>=0.2.0

New dependencies found in this round:
  adding ['django', '>=2.2', '[]']
  adding ['sqlparse', '>=0.2.0', '[]']
Removed dependencies in this round:
------------------------------------------------------------
Result of round 1: not stable

                          ROUND 2                           
Current constraints:
  django>=2.2 (from django-debug-toolbar==3.1.1->-r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))
  django-debug-toolbar (from -r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))
  sqlparse>=0.2.0 (from django-debug-toolbar==3.1.1->-r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))

Finding the best candidates:
  found candidate django==3.1.3 (constraint was >=2.2)
  found candidate django-debug-toolbar==3.1.1 (constraint was <any>)
  found candidate sqlparse==0.4.1 (constraint was >=0.2.0)

Finding secondary dependencies:
  django-debug-toolbar==3.1.1 requires django>=2.2, sqlparse>=0.2.0
  django==3.1.3             requires asgiref<4,>=3.2.10, pytz, sqlparse>=0.2.2
  sqlparse==0.4.1           requires -

New dependencies found in this round:
  adding ['asgiref', '<4,>=3.2.10', '[]']
  adding ['pytz', '', '[]']
  adding ['sqlparse', '>=0.2.0,>=0.2.2', '[]']
Removed dependencies in this round:
  removing ['sqlparse', '>=0.2.0', '[]']
------------------------------------------------------------
Result of round 2: not stable

                          ROUND 3                           
Current constraints:
  asgiref<4,>=3.2.10 (from django==3.1.3->django-debug-toolbar==3.1.1->-r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))
  django>=2.2 (from django-debug-toolbar==3.1.1->-r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))
  django-debug-toolbar (from -r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))
  pytz (from django==3.1.3->django-debug-toolbar==3.1.1->-r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))
  sqlparse>=0.2.0,>=0.2.2 (from django-debug-toolbar==3.1.1->-r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))

Finding the best candidates:
  found candidate asgiref==3.3.1 (constraint was >=3.2.10,<4)
  found candidate django==3.1.3 (constraint was >=2.2)
  found candidate django-debug-toolbar==3.1.1 (constraint was <any>)
  found candidate pytz==2020.4 (constraint was <any>)
  found candidate sqlparse==0.4.1 (constraint was >=0.2.0,>=0.2.2)

Finding secondary dependencies:
  asgiref==3.3.1            requires -
  django==3.1.3             requires asgiref<4,>=3.2.10, pytz, sqlparse>=0.2.2
  django-debug-toolbar==3.1.1 requires django>=2.2, sqlparse>=0.2.0
  sqlparse==0.4.1           requires -
  pytz==2020.4              requires -
------------------------------------------------------------
Result of round 3: stable, done

Generating hashes:
  asgiref
  django
  django-debug-toolbar
  sqlparse
  pytz
Tried constraint: <InstallRequirement object: django<3.0,>=2.2.9 editable=False>
Traceback (most recent call last):
  File "/home/kususer/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 763, in <module>
    main()
  File "/home/kususer/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 759, in main
    parsed.requirements_dir, parsed.packages, parse_only=parsed.parse_only)
  File "/home/kususer/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 741, in _main
    resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages)
  File "/home/kususer/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 714, in resolve_packages
    results = clean_results(results, resolver, project)
  File "/home/kususer/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 596, in clean_results
    entry_dict = translate_markers(entry.get_cleaned_dict(keep_outdated=False))
  File "/home/kususer/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 239, in get_cleaned_dict
    self.validate_constraints()
  File "/home/kususer/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 536, in validate_constraints
    raise DependencyConflict(msg)
pipenv.exceptions.DependencyConflict: ERROR: Cannot resolve conflicting version django<3.0,>=2.2.9 while django==3.1.3 is locked.
ROUND 1                           
Current constraints:
  django-debug-toolbar (from -r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))

Finding the best candidates:
  found candidate django-debug-toolbar==3.1.1 (constraint was <any>)

Finding secondary dependencies:
  django-debug-toolbar==3.1.1 requires django>=2.2, sqlparse>=0.2.0

New dependencies found in this round:
  adding ['django', '>=2.2', '[]']
  adding ['sqlparse', '>=0.2.0', '[]']
Removed dependencies in this round:
------------------------------------------------------------
Result of round 1: not stable

                          ROUND 2                           
Current constraints:
  django>=2.2 (from django-debug-toolbar==3.1.1->-r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))
  django-debug-toolbar (from -r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))
  sqlparse>=0.2.0 (from django-debug-toolbar==3.1.1->-r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))

Finding the best candidates:
  found candidate django==3.1.3 (constraint was >=2.2)
  found candidate django-debug-toolbar==3.1.1 (constraint was <any>)
  found candidate sqlparse==0.4.1 (constraint was >=0.2.0)

Finding secondary dependencies:
  django-debug-toolbar==3.1.1 requires django>=2.2, sqlparse>=0.2.0
  django==3.1.3             requires asgiref<4,>=3.2.10, pytz, sqlparse>=0.2.2
  sqlparse==0.4.1           requires -

New dependencies found in this round:
  adding ['asgiref', '<4,>=3.2.10', '[]']
  adding ['pytz', '', '[]']
  adding ['sqlparse', '>=0.2.0,>=0.2.2', '[]']
Removed dependencies in this round:
  removing ['sqlparse', '>=0.2.0', '[]']
------------------------------------------------------------
Result of round 2: not stable

                          ROUND 3                           
Current constraints:
  asgiref<4,>=3.2.10 (from django==3.1.3->django-debug-toolbar==3.1.1->-r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))
  django>=2.2 (from django-debug-toolbar==3.1.1->-r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))
  django-debug-toolbar (from -r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))
  pytz (from django==3.1.3->django-debug-toolbar==3.1.1->-r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))
  sqlparse>=0.2.0,>=0.2.2 (from django-debug-toolbar==3.1.1->-r /tmp/pipenv_gy3sdfkrequirements/pipenv-4p6znxo8-constraints.txt (line 2))

Finding the best candidates:
  found candidate asgiref==3.3.1 (constraint was >=3.2.10,<4)
  found candidate django==3.1.3 (constraint was >=2.2)
  found candidate django-debug-toolbar==3.1.1 (constraint was <any>)
  found candidate pytz==2020.4 (constraint was <any>)
  found candidate sqlparse==0.4.1 (constraint was >=0.2.0,>=0.2.2)

Finding secondary dependencies:
  asgiref==3.3.1            requires -
  django==3.1.3             requires asgiref<4,>=3.2.10, pytz, sqlparse>=0.2.2
  django-debug-toolbar==3.1.1 requires django>=2.2, sqlparse>=0.2.0
  sqlparse==0.4.1           requires -
  pytz==2020.4              requires -
------------------------------------------------------------
Result of round 3: stable, done

Generating hashes:
  asgiref
  django
  django-debug-toolbar
  sqlparse
  pytz
Tried constraint: <InstallRequirement object: django<3.0,>=2.2.9 editable=False>
Traceback (most recent call last):
  File "/home/kususer/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 763, in <module>
    main()
  File "/home/kususer/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 759, in main
    parsed.requirements_dir, parsed.packages, parse_only=parsed.parse_only)
  File "/home/kususer/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 741, in _main
    resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages)
  File "/home/kususer/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 714, in resolve_packages
    results = clean_results(results, resolver, project)
  File "/home/kususer/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 596, in clean_results
    entry_dict = translate_markers(entry.get_cleaned_dict(keep_outdated=False))
  File "/home/kususer/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 239, in get_cleaned_dict
    self.validate_constraints()
  File "/home/kususer/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 536, in validate_constraints
    raise DependencyConflict(msg)
pipenv.exceptions.DependencyConflict: ERROR: Cannot resolve conflicting version django<3.0,>=2.2.9 while django==3.1.3 is locked.

Steps to replicate

pipenv install 'Django>=2.2.9,<3.0'
pipenv install --dev django-debug-toolbar

$ pipenv --support

Pipenv version: '2020.11.4'

Pipenv location: '/home/kususer/.local/lib/python3.6/site-packages/pipenv'

Python location: '/usr/bin/python3'

Python installations found:

  • 3.6.8: /usr/bin/python3
  • 3.6.8: /usr/bin/python3.6
  • 3.6.8: /usr/bin/python3.6m
  • 3.6.8: /bin/python3
  • 3.6.8: /bin/python3.6
  • 3.6.8: /bin/python3.6m
  • 2.7.5: /usr/bin/python2
  • 2.7.5: /usr/bin/python2.7
  • 2.7.5: /bin/python2
  • 2.7.5: /bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.8',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '3.10.0-1160.2.2.el7.x86_64',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Sat Oct 17 05:06:47 UTC 2020',
 'python_full_version': '3.6.8',
 'python_version': '3.6',
 'sys_platform': 'linux'}

System environment variables:

  • COLORTERM
  • DBUS_SESSION_BUS_ADDRESS
  • DESKTOP_SESSION
  • DISPLAY
  • GDMSESSION
  • GDM_LANG
  • GJS_DEBUG_OUTPUT
  • GJS_DEBUG_TOPICS
  • GNOME_DESKTOP_SESSION_ID
  • GNOME_SHELL_SESSION_MODE
  • GNOME_TERMINAL_SCREEN
  • GNOME_TERMINAL_SERVICE
  • HOME
  • IMSETTINGS_INTEGRATE_DESKTOP
  • IMSETTINGS_MODULE
  • LANG
  • LESS
  • LOGNAME
  • LS_COLORS
  • PATH
  • PWD
  • QT_IM_MODULE
  • RPM_PACKAGER
  • SESSION_MANAGER
  • SHELL
  • SHLVL
  • SSH_AGENT_PID
  • SSH_AUTH_SOCK
  • TERM
  • USER
  • USERNAME
  • VTE_VERSION
  • WINDOWPATH
  • XAUTHORITY
  • XDG_CURRENT_DESKTOP
  • XDG_DATA_DIRS
  • XDG_MENU_PREFIX
  • XDG_RUNTIME_DIR
  • XDG_SEAT
  • XDG_SESSION_DESKTOP
  • XDG_SESSION_ID
  • XDG_SESSION_TYPE
  • XDG_VTNR
  • XMODIFIERS
  • fish_user_paths
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/kususer/bin/:/home/kususer/.local/bin/:/home/kususer/.poetry/bin/:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
  • SHELL: /usr/bin/fish
  • LANG: en_US.UTF-8
  • PWD: /home/kususer/Documents/pl

Contents of Pipfile ('/home/kususer/Documents/pl/Pipfile'):

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
django = ">=2.2.9,<3.0"

[dev-packages]
django-debug-toolbar = "*"

[requires]
python_version = "3.6"

Contents of Pipfile.lock ('/home/kususer/Documents/pl/Pipfile.lock'):

{
    "_meta": {
        "hash": {
            "sha256": "380611a92b6137f3ca308e9814f3889804511816acbb9b9411e8b3f3d7d73620"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.6"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "django": {
            "hashes": [
                "sha256:558cb27930defd9a6042133258caf797b2d1dee233959f537e3dc475cb49bd7c",
                "sha256:cf5370a4d7765a9dd6d42a7b96b53c74f9446cd38209211304b210fe0404b861"
            ],
            "index": "pypi",
            "version": "==2.2.17"
        },
        "pytz": {
            "hashes": [
                "sha256:3e6b7dd2d1e0a59084bcee14a17af60c5c562cdc16d828e8eba2e683d3a7e268",
                "sha256:5c55e189b682d420be27c6995ba6edce0c0a77dd67bfbe2ae6607134d5851ffd"
            ],
            "version": "==2020.4"
        },
        "sqlparse": {
            "hashes": [
                "sha256:017cde379adbd6a1f15a61873f43e8274179378e95ef3fede90b5aa64d304ed0",
                "sha256:0f91fd2e829c44362cbcfab3e9ae12e22badaa8a29ad5ff599f9ec109f0454e8"
            ],
            "markers": "python_version >= '3.5'",
            "version": "==0.4.1"
        }
    },
    "develop": {}
}

Activity

  1. frostming commented on Nov 10, 2020

    @frostming
    Contributor

    Planning to cut a release after the regression issues are fixed and if no more to be added.

  2. added a commit that references this issue on Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions