pipenv: `pipenv check` broken with Pip 10
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
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 23
- Comments: 22 (9 by maintainers)
Commits related to this issue
- Disable pipenv check until upstream bug is resolved https://github.com/pypa/pipenv/issues/1996 — committed to mcyprian/s2i-python-container by mcyprian 6 years ago
- Disable pipenv check until upstream bug is resolved https://github.com/pypa/pipenv/issues/1996 — committed to mcyprian/s2i-python-container by mcyprian 6 years ago
- Disable pipenv check until upstream bug is resolved https://github.com/pypa/pipenv/issues/1996 — committed to mcyprian/s2i-python-container by mcyprian 6 years ago
- Disable pipenv check until upstream bug is resolved https://github.com/pypa/pipenv/issues/1996 — committed to mcyprian/s2i-python-container by mcyprian 6 years ago
- Merge pull request #2005 from pypa/vendor-update Vendor update - Fixes #1996 — committed to pypa/pipenv by techalchemy 6 years ago
- Add black code formatter, and fix pipenv check See https://github.com/pypa/pipenv/issues/1996 for why pip is pinned. Basically the pipenv devs relied on an internal utility and the pip devs broke it.... — committed to eblume/hermes by eblume 6 years ago
@techalchemy thanks for the quickfix, can you please release it?
For those googling, in July 2018:
(While inside a
pipenv shell
session) I ranpip install --upgrade pip
as well aspip install --upgrade pipenv
, but it didn’t appear to work… I then deactivated the virtual environment. Re-ranpipenv shell
, and it ran just fine. 👍Just released a prerelease for testing, will release it for real tomorrow if all is well. Take it for a spin –
pip install --upgrade --pre pipenv
I resolved this by removing the virtualenv entirely.
Steps:
Update pip in environment
Update global pip
Noticed it’s broken
Remove virtualenv manually
Recreate the env
It works, and Pip is on 10.0.0
It appears to be in 11.10.1,
pipenv check
works for me now.Ran into this same issue in June 2021. The above commands worked for me.
This still works, In march 2019.
pip install --upgrade pipenv
will fix the issue@anowlcalledjosh saw this a bit ago, already working on it, scheduling this for 11.10.1 on monday