pipenv: "Could not find a version that matches", but acceptable version listed

With pipenv lock, I get a message that I can’t decipher. It lists valid constraints, and then versions that fit within those constraints, and then says it couldn’t find a matching version. One thing that looks odd to me is that it duplicates the versions found:

$ pipenv lock --verbose
Could not find a version that matches eth-account<1.0.0,>=0.1.0a2
Tried: 0.1.0a1, 0.1.0a1, 0.1.0a2, 0.1.0a2
$ python -m pipenv.help output

Pipenv version: '11.8.3'

Pipenv location: '/usr/lib/python3/dist-packages/pipenv'

Python location: '/usr/bin/python'

Other Python installations in PATH:

  • 2.7: /usr/bin/python2.7

  • 2.7: /usr/bin/python2.7

  • 3.4: /usr/bin/python3.4

  • 3.4: /usr/bin/python3.4

  • 3.5: /usr/local/bin/python3.5m

  • 3.5: /usr/local/bin/python3.5

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

  • 3.6: /usr/bin/python3.6

  • 3.6.3: /usr/bin/python

  • 2.7.14: /usr/bin/python2

  • 3.6.3: /usr/bin/python3

  • None: /usr/local/bin/py

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.3',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.13.0-32-generic',
 'platform_system': 'Linux',
 'platform_version': '#35-Ubuntu SMP Thu Jan 25 09:13:46 UTC 2018',
 'python_full_version': '3.6.3',
 'python_version': '3.6',
 'sys_platform': 'linux'}

System environment variables:

  • LS_COLORS
  • _LXSESSION_PID
  • XDG_CONFIG_HOME
  • LESSCLOSE
  • XDG_MENU_PREFIX
  • LANG
  • GDM_LANG
  • DISPLAY
  • QT_STYLE_OVERRIDE
  • GTK_OVERLAY_SCROLLING
  • XDG_VTNR
  • SSH_AUTH_SOCK
  • MANDATORY_PATH
  • S_COLORS
  • XDG_SESSION_ID
  • XDG_GREETER_DATA_DIR
  • USER
  • DESKTOP_SESSION
  • DEFAULTS_PATH
  • QT_QPA_PLATFORMTHEME
  • PWD
  • HOME
  • SSH_AGENT_PID
  • QT_ACCESSIBILITY
  • XDG_SESSION_TYPE
  • QT_PLATFORM_PLUGIN
  • XDG_DATA_DIRS
  • XDG_SESSION_DESKTOP
  • TERM
  • SHELL
  • XDG_SEAT_PATH
  • XDG_CURRENT_DESKTOP
  • MY_GETH_IPC
  • XDG_SEAT
  • SHLVL
  • LANGUAGE
  • GDMSESSION
  • LOGNAME
  • DBUS_SESSION_BUS_ADDRESS
  • XDG_RUNTIME_DIR
  • XAUTHORITY
  • XDG_SESSION_PATH
  • XDG_CONFIG_DIRS
  • PATH
  • LESSOPEN
  • _
  • OLDPWD
  • PIP_PYTHON_PATH
  • PYTHONUNBUFFERED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/jcarver/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /tmp

Contents of Pipfile (‘/tmp/Pipfile’):

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

[packages]
"web3" = "==4.0.0b11"

[dev-packages]

[requires]
python_version = "3.6"

[pipenv]
allow_prereleases = true


I’m brand new to pipenv, so apologies if I missed something straightforward.

There are a bunch of closed issues that might be related. Most of them said to expect it to be fixed in 11.8.0, but I have 11.8.3. Maybe this has to do with #1745?

Definitely thought I fixed this last night. Will have to inspect.

Expected result

An install without warnings.

Actual result

Got the warning about being unable to lock

Steps to replicate
$ pipenv install --pre --verbose web3==4.0.0b11
⠋Installing 'web3==4.0.0b11'
$ "/home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/bin/pip" install --pre  --verbose    "web3==4.0.0b11" -i https://pypi.python.org/simple --exists-action w
Requirement already satisfied: web3==4.0.0b11 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages
Requirement already satisfied: eth-account<1.0.0,>=0.1.0a2 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from web3==4.0.0b11)
Requirement already satisfied: eth-utils<2.0.0,>=1.0.0b1 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from web3==4.0.0b11)
Requirement already satisfied: eth-abi<2,>=1.0.0-beta.1 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from web3==4.0.0b11)
Requirement already satisfied: hexbytes<1.0.0,>=0.1.0b1 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from web3==4.0.0b11)
Requirement already satisfied: eth-hash[pycryptodome] in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from web3==4.0.0b11)
  Installing extra requirements: 'pycryptodome'
Requirement already satisfied: cytoolz<1.0.0,>=0.9.0 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from web3==4.0.0b11)
Requirement already satisfied: lru-dict<2.0.0,>=1.1.6 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from web3==4.0.0b11)
Requirement already satisfied: requests<3.0.0,>=2.16.0 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from web3==4.0.0b11)
Requirement already satisfied: attrdict<3,>=2.0.0 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from eth-account<1.0.0,>=0.1.0a2->web3==4.0.0b11)
Requirement already satisfied: eth-keyfile<0.6.0,>=0.5.0 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from eth-account<1.0.0,>=0.1.0a2->web3==4.0.0b11)
Requirement already satisfied: eth-keys<0.3.0,>=0.2.0b1 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from eth-account<1.0.0,>=0.1.0a2->web3==4.0.0b11)
Requirement already satisfied: eth-rlp<1,>=0.1.0a2 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from eth-account<1.0.0,>=0.1.0a2->web3==4.0.0b11)
Requirement already satisfied: pycryptodome<4,>=3.5.1; extra == "pycryptodome" in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from eth-hash[pycryptodome]->web3==4.0.0b11)
Requirement already satisfied: toolz>=0.8.0 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from cytoolz<1.0.0,>=0.9.0->web3==4.0.0b11)
Requirement already satisfied: certifi>=2017.4.17 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from requests<3.0.0,>=2.16.0->web3==4.0.0b11)
Requirement already satisfied: idna<2.7,>=2.5 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from requests<3.0.0,>=2.16.0->web3==4.0.0b11)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from requests<3.0.0,>=2.16.0->web3==4.0.0b11)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from requests<3.0.0,>=2.16.0->web3==4.0.0b11)
Requirement already satisfied: six in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from attrdict<3,>=2.0.0->eth-account<1.0.0,>=0.1.0a2->web3==4.0.0b11)
Requirement already satisfied: rlp<1,>=0.6.0 in /home/jcarver/.local/share/virtualenvs/tmp-XVr6zr33/lib/python3.6/site-packages (from eth-rlp<1,>=0.1.0a2->eth-account<1.0.0,>=0.1.0a2->web3==4.0.0b11)
Cleaning up...

Adding web3==4.0.0b11 to Pipfile's [packages]…
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Using pip: -i https://pypi.python.org/simple

                          ROUND 1                           
Current constraints:

Finding the best candidates:

Finding secondary dependencies:
------------------------------------------------------------
Result of round 1: stable, done

Locking [packages] dependencies…
Using pip: -i https://pypi.python.org/simple

                          ROUND 1                           
Current constraints:
  web3==4.0.0b11

Finding the best candidates:
  found candidate web3==4.0.0b11 (constraint was ==4.0.0b11)

Finding secondary dependencies:
  web3==4.0.0b11            requires cytoolz<1.0.0,>=0.9.0, eth-abi<2,>=1.0.0-beta.1, eth-account<1.0.0,>=0.1.0a2, eth-hash[pycryptodome], eth-utils<2.0.0,>=1.0.0b1, hexbytes<1.0.0,>=0.1.0b1, lru-dict<2.0.0,>=1.1.6, requests<3.0.0,>=2.16.0

New dependencies found in this round:
  adding ['cytoolz', '<1.0.0,>=0.9.0', '[]']
  adding ['eth-abi', '<2,>=1.0.0-beta.1', '[]']
  adding ['eth-account', '<1.0.0,>=0.1.0a2', '[]']
  adding ['eth-hash', '', "['pycryptodome']"]
  adding ['eth-utils', '<2.0.0,>=1.0.0b1', '[]']
  adding ['hexbytes', '<1.0.0,>=0.1.0b1', '[]']
  adding ['lru-dict', '<2.0.0,>=1.1.6', '[]']
  adding ['requests', '<3.0.0,>=2.16.0', '[]']
Removed dependencies in this round:
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 1: not stable

                          ROUND 2                           
Current constraints:
  cytoolz<1.0.0,>=0.9.0
  eth-abi<2,>=1.0.0-beta.1
  eth-account<1.0.0,>=0.1.0a2
  eth-hash[pycryptodome]
  eth-utils<2.0.0,>=1.0.0b1
  hexbytes<1.0.0,>=0.1.0b1
  lru-dict<2.0.0,>=1.1.6
  requests<3.0.0,>=2.16.0
  web3==4.0.0b11

Finding the best candidates:
  found candidate cytoolz==0.9.0.1 (constraint was >=0.9.0,<1.0.0)
  found candidate eth-abi==1.0.0 (constraint was >=1.0.0-beta.1,<2)
Using pip: -i https://pypi.python.org/simple

                          ROUND 1                           
Current constraints:
  web3==4.0.0b11

Finding the best candidates:
  found candidate web3==4.0.0b11 (constraint was ==4.0.0b11)

Finding secondary dependencies:
  web3==4.0.0b11            requires cytoolz<1.0.0,>=0.9.0, eth-abi<2,>=1.0.0-beta.1, eth-account<1.0.0,>=0.1.0a2, eth-hash[pycryptodome], eth-utils<2.0.0,>=1.0.0b1, hexbytes<1.0.0,>=0.1.0b1, lru-dict<2.0.0,>=1.1.6, requests<3.0.0,>=2.16.0

New dependencies found in this round:
  adding ['cytoolz', '<1.0.0,>=0.9.0', '[]']
  adding ['eth-abi', '<2,>=1.0.0-beta.1', '[]']
  adding ['eth-account', '<1.0.0,>=0.1.0a2', '[]']
  adding ['eth-hash', '', "['pycryptodome']"]
  adding ['eth-utils', '<2.0.0,>=1.0.0b1', '[]']
  adding ['hexbytes', '<1.0.0,>=0.1.0b1', '[]']
  adding ['lru-dict', '<2.0.0,>=1.1.6', '[]']
  adding ['requests', '<3.0.0,>=2.16.0', '[]']
Removed dependencies in this round:
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 1: not stable

                          ROUND 2                           
Current constraints:
  cytoolz<1.0.0,>=0.9.0
  eth-abi<2,>=1.0.0-beta.1
  eth-account<1.0.0,>=0.1.0a2
  eth-hash[pycryptodome]
  eth-utils<2.0.0,>=1.0.0b1
  hexbytes<1.0.0,>=0.1.0b1
  lru-dict<2.0.0,>=1.1.6
  requests<3.0.0,>=2.16.0
  web3==4.0.0b11

Finding the best candidates:
  found candidate cytoolz==0.9.0.1 (constraint was >=0.9.0,<1.0.0)
  found candidate eth-abi==1.0.0 (constraint was >=1.0.0-beta.1,<2)

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.
Could not find a version that matches eth-account<1.0.0,>=0.1.0a2
Tried: 0.1.0a1, 0.1.0a1, 0.1.0a2, 0.1.0a2
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.
Could not find a version that matches eth-account<1.0.0,>=0.1.0a2
Tried: 0.1.0a1, 0.1.0a1, 0.1.0a2, 0.1.0a2
$ pipenv graph
  - cytoolz [required: >=0.9.0,<1.0.0, installed: 0.9.0.1]
    - toolz [required: >=0.8.0, installed: 0.9.0]
  - eth-abi [required: >=1.0.0-beta.1,<2, installed: 1.0.0]
    - eth-utils [required: >=1.0.1,<2.0.0, installed: 1.0.1]
      - cytoolz [required: >=0.8.2,<1.0.0, installed: 0.9.0.1]
        - toolz [required: >=0.8.0, installed: 0.9.0]
      - eth-hash [required: >=0.1.0,<1.0.0, installed: 0.1.1]
  - eth-account [required: >=0.1.0a2,<1.0.0, installed: 0.1.0a2]
    - attrdict [required: <3,>=2.0.0, installed: 2.0.0]
      - six [required: Any, installed: 1.11.0]
    - eth-keyfile [required: >=0.5.0,<0.6.0, installed: 0.5.1]
      - cytoolz [required: >=0.9.0,<1.0.0, installed: 0.9.0.1]
        - toolz [required: >=0.8.0, installed: 0.9.0]
      - eth-keys [required: >=0.1.0-beta.4,<1.0.0, installed: 0.2.0b3]
        - cytoolz [required: >=0.9.0,<1.0.0, installed: 0.9.0.1]
          - toolz [required: >=0.8.0, installed: 0.9.0]
        - eth-utils [required: >=1.0.0-beta.2,<2.0.0, installed: 1.0.1]
          - cytoolz [required: >=0.8.2,<1.0.0, installed: 0.9.0.1]
            - toolz [required: >=0.8.0, installed: 0.9.0]
          - eth-hash [required: >=0.1.0,<1.0.0, installed: 0.1.1]
      - eth-utils [required: >=1.0.0-beta.1,<2.0.0, installed: 1.0.1]
        - cytoolz [required: >=0.8.2,<1.0.0, installed: 0.9.0.1]
          - toolz [required: >=0.8.0, installed: 0.9.0]
        - eth-hash [required: >=0.1.0,<1.0.0, installed: 0.1.1]
      - pycryptodome [required: >=3.4.7,<4.0.0, installed: 3.5.1]
    - eth-keys [required: <0.3.0,>=0.2.0b1, installed: 0.2.0b3]
      - cytoolz [required: >=0.9.0,<1.0.0, installed: 0.9.0.1]
        - toolz [required: >=0.8.0, installed: 0.9.0]
      - eth-utils [required: >=1.0.0-beta.2,<2.0.0, installed: 1.0.1]
        - cytoolz [required: >=0.8.2,<1.0.0, installed: 0.9.0.1]
          - toolz [required: >=0.8.0, installed: 0.9.0]
        - eth-hash [required: >=0.1.0,<1.0.0, installed: 0.1.1]
    - eth-rlp [required: >=0.1.0a2,<1, installed: 0.1.0]
      - eth-utils [required: >=1.0.1,<2, installed: 1.0.1]
        - cytoolz [required: >=0.8.2,<1.0.0, installed: 0.9.0.1]
          - toolz [required: >=0.8.0, installed: 0.9.0]
        - eth-hash [required: >=0.1.0,<1.0.0, installed: 0.1.1]
      - hexbytes [required: >=0.1.0,<1, installed: 0.1.0]
        - eth-utils [required: >=1.0.1,<2.0.0, installed: 1.0.1]
          - cytoolz [required: >=0.8.2,<1.0.0, installed: 0.9.0.1]
            - toolz [required: >=0.8.0, installed: 0.9.0]
          - eth-hash [required: >=0.1.0,<1.0.0, installed: 0.1.1]
      - rlp [required: >=0.6.0,<1, installed: 0.6.0]
    - eth-utils [required: >=1.0.0b1,<2, installed: 1.0.1]
      - cytoolz [required: >=0.8.2,<1.0.0, installed: 0.9.0.1]
        - toolz [required: >=0.8.0, installed: 0.9.0]
      - eth-hash [required: >=0.1.0,<1.0.0, installed: 0.1.1]
    - hexbytes [required: >=0.1.0b0,<1, installed: 0.1.0]
      - eth-utils [required: >=1.0.1,<2.0.0, installed: 1.0.1]
        - cytoolz [required: >=0.8.2,<1.0.0, installed: 0.9.0.1]
          - toolz [required: >=0.8.0, installed: 0.9.0]
        - eth-hash [required: >=0.1.0,<1.0.0, installed: 0.1.1]
  - eth-hash [required: Any, installed: 0.1.1]
  - eth-utils [required: >=1.0.0b1,<2.0.0, installed: 1.0.1]
    - cytoolz [required: >=0.8.2,<1.0.0, installed: 0.9.0.1]
      - toolz [required: >=0.8.0, installed: 0.9.0]
    - eth-hash [required: >=0.1.0,<1.0.0, installed: 0.1.1]
  - hexbytes [required: <1.0.0,>=0.1.0b1, installed: 0.1.0]
    - eth-utils [required: >=1.0.1,<2.0.0, installed: 1.0.1]
      - cytoolz [required: >=0.8.2,<1.0.0, installed: 0.9.0.1]
        - toolz [required: >=0.8.0, installed: 0.9.0]
      - eth-hash [required: >=0.1.0,<1.0.0, installed: 0.1.1]
  - lru-dict [required: >=1.1.6,<2.0.0, installed: 1.1.6]
  - requests [required: <3.0.0,>=2.16.0, installed: 2.18.4]
    - certifi [required: >=2017.4.17, installed: 2018.1.18]
    - chardet [required: >=3.0.2,<3.1.0, installed: 3.0.4]
    - idna [required: >=2.5,<2.7, installed: 2.6]
    - urllib3 [required: <1.23,>=1.21.1, installed: 1.22]

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 11
  • Comments: 17 (8 by maintainers)

Most upvoted comments

@carver pipenv-resolver --clear <pkgname> is what generates useful output, In any event I was able to reproduce this earlier, but then I installed with --skip-lock and ran pipenv lock --pre --clear and everything was resolved. Seems like a caching issue with some of the dependencies

Can you double check and get back to us?

@carver that is likely because you are installing into a ‘dirty’ environment with dirty caches which contain the non-prerelease versions of packages where web3 requires the prerelease versions. You’ll need to have a fresh environment and clean caches for this.

Thanks for getting back with us and sorry for the annoyance, there might be a way to auto-detect this stuff in the future but for now your best bet might be to try pipenv clean && pipenv lock --clear && pipenv sync explicitly to clean the environment, clear caches and install.

I had installed Python 3.7.4 using pyenv and I don’t fully understand the reason but my Pipfile had this line in package list

[packages]
3-7-4 = "*"

Removing the 3-7-4 line fixed the issue for me.

To echo @thetanuj I noticed that any package that pipenv install $PACKAGE fails, pipenv puts that $PACKAGE into the Pipenv file, which will in turn caused “ERROR: ERROR: Could not find a version that matches $PACKAGE”.

In my case, PACKAGE=google-cloud-python, and since I git revision controlled Pipfile I saw that line being added even though the installation failed. I removed the extra google-cloud-python = "*" line from Pipfile, I was able to get back to what it was (although I still need to find a way install google-cloud-python though.)

@hiqua pipenv lock —pre —clear