Skip to content

pipenv fails to find common version of 2 overlapping ranges #2499

Closed
@kubazarz

Description

Be sure to check the existing issues (both open and closed!).


Issue description

I have a problem when I try to install django-elasticsearch-dsl. django-elasticsearch-dsl depends on elasticsearch-dsl in versions from 2.1 to 7.0 and then elasticsearch-dsl depends on elasticsearch. If You have version 5 of ElasticSearch server, You have to use branch 5.x.x of elasticsearch-dsl. In this setup, pipenv install shows "Could not find a version that matches elasticsearch<6.0.0,<7.0.0,>=5.0.0,>=6.0.0" error. From what I can see, pipenv first resolves dependency of django-elasticsearch-dsl, installs elasticsearch-dsl in version 6.xx which depends on version 6.x.x of elasticsearch. This step creates disjoint range of versions with '>=5.0,<6.0' specified by me.

Expected result

Both elasticsearch-dsl and elasticsearch should be installed in 5.x.x versions.

Actual result

Output of pipenv install 'elasticsearch-dsl>=5.0,<6.0' --verbose

Installing elasticsearch-dsl>=5.0,<6.0...
⠋Installing 'elasticsearch-dsl>=5.0,<6.0'
$ "/Users/jakubzarzycki/.virtualenvs/overlapping-dependencies-ceWTSpaw/bin/pip" install   --verbose    "elasticsearch-dsl>=5.0,<6.0" -i https://pypi.org/simple --exists-action w
Created temporary directory: /private/var/folders/j3/6cwr6p3j2nv53372kvld_43m0000gn/T/pip-ephem-wheel-cache-a8ynqwp6
Created temporary directory: /private/var/folders/j3/6cwr6p3j2nv53372kvld_43m0000gn/T/pip-install-u783ndpr
Requirement already satisfied: elasticsearch-dsl<6.0,>=5.0 in /Users/jakubzarzycki/.virtualenvs/overlapping-dependencies-ceWTSpaw/lib/python3.6/site-packages (5.4.0)
Requirement already satisfied: six in /Users/jakubzarzycki/.virtualenvs/overlapping-dependencies-ceWTSpaw/lib/python3.6/site-packages (from elasticsearch-dsl<6.0,>=5.0) (1.11.0)
Requirement already satisfied: python-dateutil in /Users/jakubzarzycki/.virtualenvs/overlapping-dependencies-ceWTSpaw/lib/python3.6/site-packages (from elasticsearch-dsl<6.0,>=5.0) (2.7.3)
Requirement already satisfied: elasticsearch<6.0.0,>=5.0.0 in /Users/jakubzarzycki/.virtualenvs/overlapping-dependencies-ceWTSpaw/lib/python3.6/site-packages (from elasticsearch-dsl<6.0,>=5.0) (5.5.3)
Requirement already satisfied: urllib3>=1.21.1 in /Users/jakubzarzycki/.virtualenvs/overlapping-dependencies-ceWTSpaw/lib/python3.6/site-packages (from elasticsearch<6.0.0,>=5.0.0->elasticsearch-dsl<6.0,>=5.0) (1.23)
Cleaning up...

Adding elasticsearch-dsl>=5.0,<6.0 to Pipfile's [packages]...
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
using sources: [{'url': 'https://pypi.org/simple', 'verify_ssl': True, 'name': 'pypi'}]
Using pip: -i https://pypi.org/simple

                          ROUND 1
Current constraints:
  django (from -r /var/folders/j3/6cwr6p3j2nv53372kvld_43m0000gn/T/pipenv-56zch4qu-requirements/pipenv-izykcazr-constraints.txt (line 2))
  django-elasticsearch-dsl (from -r /var/folders/j3/6cwr6p3j2nv53372kvld_43m0000gn/T/pipenv-56zch4qu-requirements/pipenv-izykcazr-constraints.txt (line 3))
  elasticsearch-dsl<6.0,>=5.0 (from -r /var/folders/j3/6cwr6p3j2nv53372kvld_43m0000gn/T/pipenv-56zch4qu-requirements/pipenv-izykcazr-constraints.txt (line 4))

Finding the best candidates:
  found candidate django==2.0.7 (constraint was <any>)
  found candidate django-elasticsearch-dsl==0.5.0 (constraint was <any>)
  found candidate elasticsearch-dsl==5.4.0 (constraint was >=5.0,<6.0)

Finding secondary dependencies:
  django-elasticsearch-dsl==0.5.0 requires django-elasticsearch-dsl==0.5.0; python_version != "3.0.*" and python_version >= "2.6" and python_version != "3.2.*" and python_version != "3.1.*" and python_version < "4" and python_version != "3.3.*", elasticsearch-dsl<7.0.0,>=2.1.0, elasticsearch<7.0.0,>=6.0.0, ipaddress, python-dateutil, six, urllib3>=1.21.1
  django==2.0.7             requires django==2.0.7, pytz
  elasticsearch-dsl==5.4.0  requires elasticsearch-dsl==5.4.0; python_version != "3.0.*" and python_version >= "2.6" and python_version != "3.2.*" and python_version != "3.1.*" and python_version < "4" and python_version != "3.3.*", elasticsearch<6.0.0,>=5.0.0, python-dateutil, six, urllib3>=1.21.1

New dependencies found in this round:
  adding ['django', '==2.0.7', '[]']
  adding ['django-elasticsearch-dsl', '==0.5.0', '[]']
  adding ['elasticsearch', '<6.0.0,<7.0.0,>=5.0.0,>=6.0.0', '[]']
  adding ['elasticsearch-dsl', '<7.0.0,==5.4.0,>=2.1.0', '[]']
  adding ['ipaddress', '', '[]']
  adding ['python-dateutil', '', '[]']
  adding ['pytz', '', '[]']
  adding ['six', '', '[]']
  adding ['urllib3', '>=1.21.1', '[]']
Removed dependencies in this round:
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 1: not stable

                          ROUND 2
Current constraints:
  django==2.0.7 (from -r /var/folders/j3/6cwr6p3j2nv53372kvld_43m0000gn/T/pipenv-56zch4qu-requirements/pipenv-izykcazr-constraints.txt (line 2))
  django-elasticsearch-dsl==0.5.0 (from -r /var/folders/j3/6cwr6p3j2nv53372kvld_43m0000gn/T/pipenv-56zch4qu-requirements/pipenv-izykcazr-constraints.txt (line 3))
  elasticsearch<6.0.0,<7.0.0,>=5.0.0,>=6.0.0
  elasticsearch-dsl<6.0,<7.0.0,==5.4.0,>=2.1.0,>=5.0 (from -r /var/folders/j3/6cwr6p3j2nv53372kvld_43m0000gn/T/pipenv-56zch4qu-requirements/pipenv-izykcazr-constraints.txt (line 4))
  ipaddress
  python-dateutil
  pytz
  six
  urllib3>=1.21.1

Finding the best candidates:
  found candidate django==2.0.7 (constraint was ==2.0.7)
  found candidate django-elasticsearch-dsl==0.5.0 (constraint was ==0.5.0)
Using pip: -i https://pypi.org/simple

                          ROUND 1
Current constraints:
  django (from -r /var/folders/j3/6cwr6p3j2nv53372kvld_43m0000gn/T/pipenv-56zch4qu-requirements/pipenv-sybcv5b1-constraints.txt (line 2))
  django-elasticsearch-dsl (from -r /var/folders/j3/6cwr6p3j2nv53372kvld_43m0000gn/T/pipenv-56zch4qu-requirements/pipenv-sybcv5b1-constraints.txt (line 3))
  elasticsearch-dsl<6.0,>=5.0 (from -r /var/folders/j3/6cwr6p3j2nv53372kvld_43m0000gn/T/pipenv-56zch4qu-requirements/pipenv-sybcv5b1-constraints.txt (line 4))

Finding the best candidates:
  found candidate django==2.0.7 (constraint was <any>)
  found candidate django-elasticsearch-dsl==0.5.0 (constraint was <any>)
  found candidate elasticsearch-dsl==5.4.0 (constraint was >=5.0,<6.0)

Finding secondary dependencies:
  django-elasticsearch-dsl==0.5.0 requires django-elasticsearch-dsl==0.5.0; python_version != "3.0.*" and python_version >= "2.6" and python_version != "3.2.*" and python_version != "3.1.*" and python_version < "4" and python_version != "3.3.*", elasticsearch-dsl<7.0.0,>=2.1.0, elasticsearch<7.0.0,>=6.0.0, ipaddress, python-dateutil, six, urllib3>=1.21.1
  elasticsearch-dsl==5.4.0  requires elasticsearch-dsl==5.4.0; python_version != "3.0.*" and python_version >= "2.6" and python_version != "3.2.*" and python_version != "3.1.*" and python_version < "4" and python_version != "3.3.*", elasticsearch<6.0.0,>=5.0.0, python-dateutil, six, urllib3>=1.21.1
  django==2.0.7             requires django==2.0.7, pytz

New dependencies found in this round:
  adding ['django', '==2.0.7', '[]']
  adding ['django-elasticsearch-dsl', '==0.5.0', '[]']
  adding ['elasticsearch', '<6.0.0,<7.0.0,>=5.0.0,>=6.0.0', '[]']
  adding ['elasticsearch-dsl', '<7.0.0,==5.4.0,>=2.1.0', '[]']
  adding ['ipaddress', '', '[]']
  adding ['python-dateutil', '', '[]']
  adding ['pytz', '', '[]']
  adding ['six', '', '[]']
  adding ['urllib3', '>=1.21.1', '[]']
Removed dependencies in this round:
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 1: not stable

                          ROUND 2
Current constraints:
  django==2.0.7 (from -r /var/folders/j3/6cwr6p3j2nv53372kvld_43m0000gn/T/pipenv-56zch4qu-requirements/pipenv-sybcv5b1-constraints.txt (line 2))
  django-elasticsearch-dsl==0.5.0 (from -r /var/folders/j3/6cwr6p3j2nv53372kvld_43m0000gn/T/pipenv-56zch4qu-requirements/pipenv-sybcv5b1-constraints.txt (line 3))
  elasticsearch<6.0.0,<7.0.0,>=5.0.0,>=6.0.0
  elasticsearch-dsl<6.0,<7.0.0,==5.4.0,>=2.1.0,>=5.0 (from -r /var/folders/j3/6cwr6p3j2nv53372kvld_43m0000gn/T/pipenv-56zch4qu-requirements/pipenv-sybcv5b1-constraints.txt (line 4))
  ipaddress
  python-dateutil
  pytz
  six
  urllib3>=1.21.1

Finding the best candidates:
  found candidate django==2.0.7 (constraint was ==2.0.7)
  found candidate django-elasticsearch-dsl==0.5.0 (constraint was ==0.5.0)

Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
Could not find a version that matches elasticsearch<6.0.0,<7.0.0,>=5.0.0,>=6.0.0
Tried: 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.4.4, 0.4.5, 0.4.5, 1.0.0, 1.0.0, 1.1.0, 1.1.0, 1.1.1, 1.1.1, 1.2.0, 1.2.0, 1.3.0, 1.3.0, 1.4.0, 1.4.0, 1.5.0, 1.5.0, 1.6.0, 1.6.0, 1.7.0, 1.7.0, 1.8.0, 1.8.0, 1.9.0, 1.9.0, 2.0.0, 2.0.0, 2.1.0, 2.1.0, 2.2.0, 2.2.0, 2.3.0, 2.3.0, 2.4.0, 2.4.0, 2.4.1, 2.4.1, 5.0.0, 5.0.0, 5.0.1, 5.0.1, 5.1.0, 5.1.0, 5.2.0, 5.2.0, 5.3.0, 5.3.0, 5.4.0, 5.4.0, 5.5.0, 5.5.0, 5.5.1, 5.5.1, 5.5.2, 5.5.2, 5.5.3, 5.5.3, 6.0.0, 6.0.0, 6.1.1, 6.1.1, 6.2.0, 6.2.0, 6.3.0, 6.3.0
There are incompatible versions in the resolved dependencies.
Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
Could not find a version that matches elasticsearch<6.0.0,<7.0.0,>=5.0.0,>=6.0.0
Tried: 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.4.4, 0.4.5, 0.4.5, 1.0.0, 1.0.0, 1.1.0, 1.1.0, 1.1.1, 1.1.1, 1.2.0, 1.2.0, 1.3.0, 1.3.0, 1.4.0, 1.4.0, 1.5.0, 1.5.0, 1.6.0, 1.6.0, 1.7.0, 1.7.0, 1.8.0, 1.8.0, 1.9.0, 1.9.0, 2.0.0, 2.0.0, 2.1.0, 2.1.0, 2.2.0, 2.2.0, 2.3.0, 2.3.0, 2.4.0, 2.4.0, 2.4.1, 2.4.1, 5.0.0, 5.0.0, 5.0.1, 5.0.1, 5.1.0, 5.1.0, 5.2.0, 5.2.0, 5.3.0, 5.3.0, 5.4.0, 5.4.0, 5.5.0, 5.5.0, 5.5.1, 5.5.1, 5.5.2, 5.5.2, 5.5.3, 5.5.3, 6.0.0, 6.0.0, 6.1.1, 6.1.1, 6.2.0, 6.2.0, 6.3.0, 6.3.0
There are incompatible versions in the resolved dependencies.

➜  overlapping-dependencies pipenv graph
Django==2.0.7
  - pytz [required: Any, installed: 2018.5]
django-elasticsearch-dsl==0.5.0
  - elasticsearch-dsl [required: >=2.1.0,<7.0.0, installed: 5.4.0]
    - elasticsearch [required: >=5.0.0,<6.0.0, installed: 5.5.3]
      - urllib3 [required: >=1.21.1, installed: 1.23]
    - python-dateutil [required: Any, installed: 2.7.3]
      - six [required: >=1.5, installed: 1.11.0]
    - six [required: Any, installed: 1.11.0]
ipaddress==1.0.22
Steps to replicate

Provide the steps to replicate (which usually at least includes the commands and the Pipfile).


$ pipenv --support

Pipenv version: '2018.7.1'

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

Python location: '/usr/local/opt/python/bin/python3.6'

Other Python installations in PATH:

  • 2.7: /usr/bin/python2.7

  • 2.7: /usr/bin/python2.7

  • 2.7: /usr/local/bin/python2.7

  • 3.6: /usr/local/bin/python3.6m

  • 3.6: /usr/local/bin/python3.6

  • 3.6.5: /usr/local/opt/python/libexec/bin/python

  • 2.7.10: /usr/bin/python

  • 2.7.15: /usr/local/bin/python

  • 2.7.15: /usr/local/bin/python2

  • 3.6.5: /usr/local/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.5',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '17.6.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 17.6.0: Tue May  8 15:22:16 PDT '
                     '2018; root:xnu-4570.61.1~1/RELEASE_X86_64',
 'python_full_version': '3.6.5',
 'python_version': '3.6',
 'sys_platform': 'darwin'}

System environment variables:

  • TERM_SESSION_ID
  • SSH_AUTH_SOCK
  • Apple_PubSub_Socket_Render
  • COLORFGBG
  • ITERM_PROFILE
  • XPC_FLAGS
  • LANG
  • PWD
  • SHELL
  • SECURITYSESSIONID
  • TERM_PROGRAM_VERSION
  • TERM_PROGRAM
  • PATH
  • COLORTERM
  • COMMAND_MODE
  • TERM
  • HOME
  • TMPDIR
  • USER
  • XPC_SERVICE_NAME
  • LOGNAME
  • __CF_USER_TEXT_ENCODING
  • ITERM_SESSION_ID
  • SHLVL
  • OLDPWD
  • ZSH
  • PAGER
  • LESS
  • LC_CTYPE
  • LSCOLORS
  • WORKON_HOME
  • VIRTUALENVWRAPPER_PROJECT_FILENAME
  • VIRTUALENVWRAPPER_WORKON_CD
  • VIRTUALENVWRAPPER_SCRIPT
  • VIRTUALENVWRAPPER_HOOK_DIR
  • _
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /usr/local/opt/python/libexec/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  • SHELL: /bin/zsh
  • LANG: pl_PL.UTF-8
  • PWD: /Users/jakubzarzycki/tmp/overlapping-dependencies

Contents of Pipfile ('/Users/jakubzarzycki/tmp/overlapping-dependencies/Pipfile'):

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

[packages]
django = "*"
django-elasticsearch-dsl = "*"
elasticsearch-dsl = "<6.0,>=5.0"

[dev-packages]

[requires]
python_version = "3.6"

Metadata

Assignees

No one assigned

    Labels

    Category: FutureIssue is planned for the future.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions