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 check` broken with Pip 10

See original GitHub issue

With Pip 10, pipenv check fails with an exception in the safety library. The vendored version of safety needs updating; as of 10 days ago, it now supports Pip 10 (c.f. commit pyupio/safety@051c156fcf4272c18ea8aab8c4277efcd56e3c0f).

$ python -m pipenv.help output

Pipenv version: '11.10.0'

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

Python location: '/home/josh/.local/venvs/pipenv/bin/python'

Other Python installations in PATH:

  • 2.7: /home/josh/systemetric/sr-robot/.venv/bin/python2.7

  • 2.7: /home/josh/systemetric/sr-robot/.venv/bin/python2.7

  • 2.7: /usr/bin/python2.7

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

  • 3.5: /usr/bin/python3.5

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

  • 3.6: /usr/bin/python3.6

  • 2.7.12: /home/josh/systemetric/sr-robot/.venv/bin/python

  • 2.7.12: /usr/bin/python

  • 2.7.12: /home/josh/systemetric/sr-robot/.venv/bin/python2

  • 2.7.12: /usr/bin/python2

  • 3.5.2: /usr/bin/python3

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-38-generic',
 'platform_system': 'Linux',
 'platform_version': '#43~16.04.1-Ubuntu SMP Wed Mar 14 17:48:43 UTC 2018',
 'python_full_version': '3.6.3',
 'python_version': '3.6',
 'sys_platform': 'linux'}

System environment variables:

  • CLUTTER_IM_MODULE
  • PIPENV_VENV_IN_PROJECT
  • PYTHONUNBUFFERED
  • NVM_DIR
  • LS_COLORS
  • GNOME_KEYRING_PID
  • GIT_PS1_SHOWUNTRACKEDFILES
  • XDG_CONFIG_HOME
  • LESSCLOSE
  • LANG
  • GDM_LANG
  • LESS
  • DISPLAY
  • PYENV_ROOT
  • OLDPWD
  • WORKON_HOME
  • EDITOR
  • COMPIZ_CONFIG_PROFILE
  • GTK2_MODULES
  • GPG_TTY
  • UPSTART_INSTANCE
  • PIPENV_SHELL_FANCY
  • DEBFULLNAME
  • XDG_VTNR
  • RIPGREP_CONFIG_PATH
  • SSH_AUTH_SOCK
  • VIRTUAL_ENV
  • MANDATORY_PATH
  • SESSIONTYPE
  • TMUX_PLUGIN_MANAGER_PATH
  • XDG_SESSION_ID
  • XDG_GREETER_DATA_DIR
  • USER
  • DESKTOP_SESSION
  • JOB
  • QT4_IM_MODULE
  • GOPATH
  • PIP_PYTHON_PATH
  • DEFAULTS_PATH
  • QT_QPA_PLATFORMTHEME
  • PWD
  • MANPAGER
  • HOME
  • GIT_PS1_SHOWDIRTYSTATE
  • SSH_AGENT_PID
  • QT_ACCESSIBILITY
  • TMUX
  • XDG_SESSION_TYPE
  • XDG_DATA_DIRS
  • UPSTART_SESSION
  • PIPENV_ACTIVE
  • XDG_SESSION_DESKTOP
  • GIT_PS1_SHOWUPSTREAM
  • GTK_MODULES
  • UPSTART_EVENTS
  • VISUAL
  • VTE_VERSION
  • TERM
  • SHELL
  • GNOME_KEYRING_CONTROL
  • XDG_SEAT_PATH
  • QT_IM_MODULE
  • XMODIFIERS
  • IM_CONFIG_PHASE
  • GIT_PS1_SHOWSTASHSTATE
  • INSTANCE
  • XDG_CURRENT_DESKTOP
  • GPG_AGENT_INFO
  • QT_LINUX_ACCESSIBILITY_ALWAYS_ON
  • TMUX_VERSION
  • TMUX_PANE
  • PYTHONDONTWRITEBYTECODE
  • XDG_SEAT
  • SHLVL
  • LANGUAGE
  • WINDOWID
  • DEBEMAIL
  • GDMSESSION
  • GNOME_DESKTOP_SESSION_ID
  • XDG_CACHE_HOME
  • LOGNAME
  • DBUS_SESSION_BUS_ADDRESS
  • UPSTART_JOB
  • XDG_RUNTIME_DIR
  • XAUTHORITY
  • XDG_DATA_HOME
  • XDG_SESSION_PATH
  • XDG_CONFIG_DIRS
  • PATH
  • MYPYPATH
  • LESSOPEN
  • GTK_IM_MODULE
  • _

Pipenv–specific environment variables:

  • PIPENV_VENV_IN_PROJECT: 1
  • PIPENV_SHELL_FANCY: 1
  • PIPENV_ACTIVE: 1

Debug–specific environment variables:

  • PATH: /home/josh/systemetric/sr-robot/.venv/bin:/home/josh/go/bin:/home/josh/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/josh/.cargo/bin:/home/josh/.cabal/bin:/home/josh/bin:/home/josh/.local/bin
  • SHELL: /bin/bash
  • EDITOR: vim
  • LANG: en_GB.UTF-8
  • PWD: /home/josh/systemetric/sr-robot
  • VIRTUAL_ENV: /home/josh/systemetric/sr-robot/.venv

Contents of Pipfile (‘/home/josh/systemetric/sr-robot/Pipfile’):

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

[packages]

[dev-packages]
"flake8" = "*"
pytype = {git = "ssh://git@github.com/google/pytype.git"}

[requires]
python_version = "2.7"

Contents of Pipfile.lock (‘/home/josh/systemetric/sr-robot/Pipfile.lock’):

{
    "_meta": {
        "hash": {
            "sha256": "1e4788741aca44c08d80c24de2037a2bfddfd51bd917745b626f0ca5dbe2177a"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "2.7"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.python.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {},
    "develop": {
        "configparser": {
            "hashes": [
                "sha256:5308b47021bc2340965c371f0f058cc6971a04502638d4244225c49d80db273a"
            ],
            "markers": "python_version < '3.2'",
            "version": "==3.5.0"
        },
        "enum34": {
            "hashes": [
                "sha256:2d81cbbe0e73112bdfe6ef8576f2238f2ba27dd0d55752a776c41d38b7da2850",
                "sha256:644837f692e5f550741432dd3f223bbb9852018674981b1664e5dc339387588a",
                "sha256:6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79",
                "sha256:8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1"
            ],
            "markers": "python_version < '3.4'",
            "version": "==1.1.6"
        },
        "flake8": {
            "hashes": [
                "sha256:7253265f7abd8b313e3892944044a365e3f4ac3fcdcfb4298f55ee9ddf188ba0",
                "sha256:c7841163e2b576d435799169b78703ad6ac1bbb0f199994fc05f700b2a90ea37"
            ],
            "index": "pypi",
            "version": "==3.5.0"
        },
        "mccabe": {
            "hashes": [
                "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42",
                "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"
            ],
            "version": "==0.6.1"
        },
        "pycodestyle": {
            "hashes": [
                "sha256:1ec08a51c901dfe44921576ed6e4c1f5b7ecbad403f871397feedb5eb8e4fa14",
                "sha256:5ff2fbcbab997895ba9ead77e1b38b3ebc2e5c3b8a6194ef918666e4c790a00e",
                "sha256:682256a5b318149ca0d2a9185d365d8864a768a28db66a84a2ea946bcc426766",
                "sha256:6c4245ade1edfad79c3446fadfc96b0de2759662dc29d07d80a6f27ad1ca6ba9"
            ],
            "version": "==2.3.1"
        },
        "pyflakes": {
            "hashes": [
                "sha256:08bd6a50edf8cffa9fa09a463063c425ecaaf10d1eb0335a7e8b1401aef89e6f",
                "sha256:8d616a382f243dbf19b54743f280b80198be0bca3a5396f1d2e1fca6223e8805"
            ],
            "version": "==1.6.0"
        },
        "pytype": {
            "git": "ssh://git@github.com/google/pytype.git"
        }
    }
}


Expected result

Problems with installed packages’ security are printed.

Actual result
$ pipenv check --verbose
Checking PEP 508 requirements…
Passed!
Checking installed package safety…
An error occurred:
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/josh/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/patched/safety.zip/__main__.py", line 8, in <module>
  File "/home/josh/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/patched/safety.zip/click/core.py", line 722, in __call__
  File "/home/josh/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/patched/safety.zip/click/core.py", line 697, in main
  File "/home/josh/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/patched/safety.zip/click/core.py", line 1066, in invoke
  File "/home/josh/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/patched/safety.zip/click/core.py", line 895, in invoke
  File "/home/josh/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/patched/safety.zip/click/core.py", line 535, in invoke
  File "/home/josh/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/patched/safety.zip/safety/cli.py", line 52, in check
AttributeError: 'module' object has no attribute 'get_installed_distributions'
Steps to replicate
$ pipenv check

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:23
  • Comments:22 (9 by maintainers)

github_iconTop GitHub Comments

13reactions
sobolevncommented, Apr 17, 2018

@techalchemy thanks for the quickfix, can you please release it?

11reactions
tcgcommented, Jul 23, 2018

For those googling, in July 2018:

(While inside a pipenv shell session) I ran pip install --upgrade pip as well as pip install --upgrade pipenv, but it didn’t appear to work… I then deactivated the virtual environment. Re-ran pipenv shell, and it ran just fine. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common Pipenv Errors and How to Solve Them: Why Won't it ...
Here, you'll learn how to troubleshoot Pipenv installation and locking issues. For more information on Pipenv, or environments, check out this Medium article!...
Read more >
Frequently Encountered Pipenv Problems - Read the Docs
This is usually a result of mixing Pipenv with system packages. We strongly recommend installing Pipenv in an isolated environment. Uninstall all existing ......
Read more >
Windows reports error when trying to install package using ...
Just enter pipenv --version in the command prompt and you should see the desired output. Notes. I know this sounds the mundane, but...
Read more >
How to Update All Python Packages - ActiveState
Update all Python Packages on Windows · Open a command shell by typing 'powershell' in the Search Box of the Task bar ·...
Read more >
pipenv Documentation
Should you change your project's path, you break such a default mapping ... Find out what's changed upstream: $ pipenv update --outdated.
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