question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pipenv.lock updated with package version that does not exist

See original GitHub issue

Issue description

I think that the problem is that pipenv does not filter existing packages by target platform during the lock step, which can result in failing installation if a package has a new version available for a different platform. Here’s my concrete example: I have llvmlite as a transitive dependency (hence it is not manually pinned; I let pipenv lock do that). llvmlite updated from 0.27.0 to 0.27.1 but only for MacOS, because that is the only platform for which the update was needed. I am working on Linux, and when I run pipenv lock my Pipfile.lock is updated with llvmlite==0.27.1, but subsequently when I run pipenv install, it fails listing all the available llvmlite versions, i.e., up to 0.27.0.

Expected result

I expected pipenv lock to look only for versions of packages that are available for the current

Actual result

$ pipenv install --verbose llvmlite

Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning. Creating a Pipfile for this project… Installing llvmlite…

⠋ Installing…Installing ‘llvmlite’ $ [‘/home/atzannes/src/Platform/.venv/bin/pip’, ‘install’, ‘–verbose’, ‘–upgrade’, ‘llvmlite’, ‘-i’, ‘https://pypi.org/simple’]  ⠙ Installing… ⠹ Installing… ⠸ Installing… ⠼ Installing… ⠴ Installing… Adding llvmlite to Pipfile’s [packages]… ✔ Installation Succeeded Pipfile.lock not found, creating… Locking [dev-packages] dependencies… Locking [packages] dependencies…

⠋ Locking… ⠙ Locking… ⠹ Locking… ⠸ Locking… ⠼ Locking… ⠴ Locking… ⠦ Locking… ⠧ Locking…✔ Success! Using pip: -i https://pypi.org/simple Using pip: -i https://pypi.org/simple Using pip: -i https://pypi.org/simple

                      ROUND 1                           

Current constraints: llvmlite

Finding the best candidates: found candidate llvmlite==0.27.1 (constraint was <any>)

Finding secondary dependencies: llvmlite==0.27.1 requires enum34

New dependencies found in this round: adding [‘enum34’, ‘’, ‘[]’] Removed dependencies in this round: Unsafe dependencies in this round:

Result of round 1: not stable

                      ROUND 2                           

Current constraints: enum34 llvmlite

Finding the best candidates: found candidate enum34==1.1.6 (constraint was <any>) found candidate llvmlite==0.27.1 (constraint was <any>)

Finding secondary dependencies: llvmlite==0.27.1 requires enum34 enum34==1.1.6 requires -

Result of round 2: stable, done

Updated Pipfile.lock (ccb146)! Installing dependencies from Pipfile.lock (ccb146)… Installing ‘enum34’ $ [‘/home/atzannes/src/Platform/.venv/bin/pip’, ‘install’, ‘–verbose’, ‘–upgrade’, ‘–no-deps’, ‘-r’, ‘/tmp/pipenv-1wjgyfzn-requirements/pipenv-rvua5w5w-requirement.txt’, ‘-i’, ‘https://pypi.org/simple’, ‘–require-hashes’] Installing ‘llvmlite’ $ [‘/home/atzannes/src/Platform/.venv/bin/pip’, ‘install’, ‘–verbose’, ‘–upgrade’, ‘–no-deps’, ‘-r’, ‘/tmp/pipenv-1wjgyfzn-requirements/pipenv-l9iasm3p-requirement.txt’, ‘-i’, ‘https://pypi.org/simple’, ‘–require-hashes’] Created temporary directory: /tmp/pip-ephem-wheel-cache-1umiikp6 Created temporary directory: /tmp/pip-req-tracker-h8utwcx7 Created requirements tracker ‘/tmp/pip-req-tracker-h8utwcx7’ Created temporary directory: /tmp/pip-install-rnvy3jao 1 location(s) to search for versions of enum34:

Steps to replicate

On a non-MacOS platform: pipenv install llvmlite


$ pipenv --support

Pipenv version: '2018.11.26'

Pipenv location: '/home/atzannes/src/Platform/.venv/lib/python3.6/site-packages/pipenv'

Python location: '/home/atzannes/src/Platform/.venv/bin/python3'

Python installations found:

  • 3.6.7: /home/atzannes/src/Platform/.venv/bin/python3
  • 3.6.7: /home/atzannes/.pyenv/versions/3.6.7/bin/python3
  • 3.6.7: /home/atzannes/.pyenv/versions/3.6.7/bin/python3.6m
  • 3.6.7: /usr/bin/python3
  • 3.6.7: /usr/bin/python3.6m
  • 2.7.15rc1: /usr/bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.7',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.15.0-43-generic',
 'platform_system': 'Linux',
 'platform_version': '#46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018',
 'python_full_version': '3.6.7',
 'python_version': '3.6',
 'sys_platform': 'linux'}

System environment variables:

  • CLUTTER_IM_MODULE
  • LS_COLORS
  • LESSCLOSE
  • XDG_MENU_PREFIX
  • LANG
  • DISPLAY
  • PYENV_ROOT
  • OLDPWD
  • GNOME_SHELL_SESSION_MODE
  • COLORTERM
  • DESKTOP_AUTOSTART_ID
  • PYENV_VIRTUALENV_INIT
  • USERNAME
  • XDG_VTNR
  • SSH_AUTH_SOCK
  • VIRTUAL_ENV
  • XDG_SESSION_ID
  • USER
  • DESKTOP_SESSION
  • QT4_IM_MODULE
  • TEXTDOMAINDIR
  • GNOME_TERMINAL_SCREEN
  • PWD
  • HOME
  • TEXTDOMAIN
  • SSH_AGENT_PID
  • QT_ACCESSIBILITY
  • XDG_SESSION_TYPE
  • XDG_DATA_DIRS
  • XDG_SESSION_DESKTOP
  • GTK_MODULES
  • WINDOWPATH
  • TERM
  • SHELL
  • VTE_VERSION
  • QT_IM_MODULE
  • XMODIFIERS
  • IM_CONFIG_PHASE
  • XDG_CURRENT_DESKTOP
  • GPG_AGENT_INFO
  • GNOME_TERMINAL_SERVICE
  • PYENV_SHELL
  • XDG_SEAT
  • SHLVL
  • GDMSESSION
  • GNOME_DESKTOP_SESSION_ID
  • LOGNAME
  • DBUS_SESSION_BUS_ADDRESS
  • XDG_RUNTIME_DIR
  • XAUTHORITY
  • XDG_CONFIG_DIRS
  • PATH
  • PS1
  • SESSION_MANAGER
  • LESSOPEN
  • GTK_IM_MODULE
  • _
  • 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/atzannes/src/Platform/.venv/bin:/home/atzannes/.pyenv/plugins/pyenv-virtualenv/shims:/home/atzannes/.pyenv/shims:/home/atzannes/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/atzannes/.myconfig/scripts:/home/atzannes/.local/bin
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /home/atzannes/src/depbug
  • VIRTUAL_ENV: /home/atzannes/src/Platform/.venv

Contents of Pipfile (‘/home/atzannes/src/depbug/Pipfile’):

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

[dev-packages]

[packages]
llvmlite = "*"

[requires]
python_version = "3.6"

Contents of Pipfile.lock (‘/home/atzannes/src/depbug/Pipfile.lock’):

{
    "_meta": {
        "hash": {
            "sha256": "2f1c1b13918ab0530593c417be410f1a3e2372355b7281a859fc17a182ccb146"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.6"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "enum34": {
            "hashes": [
                "sha256:2d81cbbe0e73112bdfe6ef8576f2238f2ba27dd0d55752a776c41d38b7da2850",
                "sha256:644837f692e5f550741432dd3f223bbb9852018674981b1664e5dc339387588a",
                "sha256:6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79",
                "sha256:8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1"
            ],
            "version": "==1.1.6"
        },
        "llvmlite": {
            "hashes": [
                "sha256:4cbe079cb1eeaf4c90e1b75b2ef314ebb0ea5b4c420298e96065eafa3a0d0b0e",
                "sha256:7d05fca7ba5f5bf6d0ccefc99a10c54e0d5cc80d7b8003496372abc0f65be468",
                "sha256:ceed23df15ec814f9bd4ddbd8a8f9d7acb986fb571f7f034ec1f7f6cbed16cde"
            ],
            "index": "pypi",
            "version": "==0.27.1"
        }
    },
    "develop": {}
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
iAmGhostcommented, Feb 7, 2019

I have this problem with llvmlite and numba (v0.42.1 seems to be an update for the MacOS wheel hash issue as well.

My problem is I’m developing on a Mac and deploying to Linux. I’m very new to Python and pipenv, I’m struggling to work out how to pin specific versions (on the different platforms).

Pinning version manually(pipenv install llvmlite==0.27.0 and pipenv install numba==0.42.0) solves this temporary.

0reactions
matteiuscommented, Mar 13, 2022

@atzannes I believe this is closeable at this point, but correct me if you find there are still related issues with pipenv==2022.1.8

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix "ERROR: Could not find a version that matches ...
First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again. Alternatively, you can use $ pipenv ......
Read more >
Common Pipenv Errors and How to Solve Them: Why Won't it ...
Pipfile won't lock when it tries to install packages that don't exist, i.e., typos. Pipenv looks for the package you specify, whether it...
Read more >
Basic Usage of Pipenv - Read the Docs
$ pipenv lock is used to create a Pipfile.lock , which declares all dependencies (and sub-dependencies) of your project, their latest available versions,...
Read more >
pipenv · PyPI
Automatically generates a Pipfile , if one doesn't exist. ... You can install packages with pipenv from git and other version control systems...
Read more >
Pipenv: A Guide to the New Python Packaging Tool
To demonstrate, let's say a new version of one of your dependencies becomes available. Because you don't need a specific version of this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found