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.72.7: /home/josh/systemetric/sr-robot/.venv/bin/python2.72.7: /usr/bin/python2.73.5: /usr/bin/python3.5m3.5: /usr/bin/python3.53.6: /usr/bin/python3.6m3.6: /usr/bin/python3.6
2.7.12: /home/josh/systemetric/sr-robot/.venv/bin/python
2.7.12: /usr/bin/python2.7.12: /home/josh/systemetric/sr-robot/.venv/bin/python22.7.12: /usr/bin/python23.5.2: /usr/bin/python3PEP 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_MODULEPIPENV_VENV_IN_PROJECTPYTHONUNBUFFEREDNVM_DIRLS_COLORSGNOME_KEYRING_PIDGIT_PS1_SHOWUNTRACKEDFILESXDG_CONFIG_HOMELESSCLOSELANGGDM_LANGLESSDISPLAYPYENV_ROOTOLDPWDWORKON_HOMEEDITORCOMPIZ_CONFIG_PROFILEGTK2_MODULESGPG_TTYUPSTART_INSTANCEPIPENV_SHELL_FANCYDEBFULLNAMEXDG_VTNRRIPGREP_CONFIG_PATHSSH_AUTH_SOCKVIRTUAL_ENVMANDATORY_PATHSESSIONTYPETMUX_PLUGIN_MANAGER_PATHXDG_SESSION_IDXDG_GREETER_DATA_DIRUSERDESKTOP_SESSIONJOBQT4_IM_MODULEGOPATHPIP_PYTHON_PATHDEFAULTS_PATHQT_QPA_PLATFORMTHEMEPWDMANPAGERHOMEGIT_PS1_SHOWDIRTYSTATESSH_AGENT_PIDQT_ACCESSIBILITYTMUXXDG_SESSION_TYPEXDG_DATA_DIRSUPSTART_SESSIONPIPENV_ACTIVEXDG_SESSION_DESKTOPGIT_PS1_SHOWUPSTREAMGTK_MODULESUPSTART_EVENTSVISUALVTE_VERSIONTERMSHELLGNOME_KEYRING_CONTROLXDG_SEAT_PATHQT_IM_MODULEXMODIFIERSIM_CONFIG_PHASEGIT_PS1_SHOWSTASHSTATEINSTANCEXDG_CURRENT_DESKTOPGPG_AGENT_INFOQT_LINUX_ACCESSIBILITY_ALWAYS_ONTMUX_VERSIONTMUX_PANEPYTHONDONTWRITEBYTECODEXDG_SEATSHLVLLANGUAGEWINDOWIDDEBEMAILGDMSESSIONGNOME_DESKTOP_SESSION_IDXDG_CACHE_HOMELOGNAMEDBUS_SESSION_BUS_ADDRESSUPSTART_JOBXDG_RUNTIME_DIRXAUTHORITYXDG_DATA_HOMEXDG_SESSION_PATHXDG_CONFIG_DIRSPATHMYPYPATHLESSOPENGTK_IM_MODULE_Pipenv–specific environment variables:
PIPENV_VENV_IN_PROJECT: 1PIPENV_SHELL_FANCY: 1PIPENV_ACTIVE: 1Debug–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/binSHELL: /bin/bashEDITOR: vimLANG: en_GB.UTF-8PWD: /home/josh/systemetric/sr-robotVIRTUAL_ENV: /home/josh/systemetric/sr-robot/.venvContents 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://[email protected]/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://[email protected]/google/pytype.git"
}
}
}
Problems with installed packages' security are printed.
$ 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'
$ pipenv check
@anowlcalledjosh saw this a bit ago, already working on it, scheduling this for 11.10.1 on monday
thanks for the note and the reference, trying to get our vendoring process a bit more automated to help with this stuff
If anyone needs a fix in the meantime (in our case not being able to deploy without passing checks) just pipenv install pip==9.0.2 in the repository you need. I've spent quite a while looking at system's pip and wondering what's wrong :)
Downgrading pip to <10 worked. But I was confused that it was a pipenv issue, not safety issue.
File "/usr/local/lib/python3.6/site-packages/pipenv/patched/safety.zip/safety/cli.py", line 52, in check
Here's a failing build link: https://travis-ci.org/wemake-services/wemake-django-template/builds/367106163#L777
I resolved this by removing the virtualenv entirely.
Steps:
Update pip in environment
pipenv run pip install -U pip
Update global pip
pip install --user -U pip
Noticed it’s broken
pipenv sync
Remove virtualenv manually
rm -rf ~/.local/share/virtualenvs/env-name
Recreate the env
pipenv sync
It works, and Pip is on 10.0.0
pipenv run pip --version
Hoping to get a release out today with a fix
@sobolevn it _was_ a safety issue, but we bundle safety and they already addressed this so we needed to upgrade it
@techalchemy thanks for the quickfix, can you please release it?
Hello,
Thank you for the work done on pipenv!
Is the fix released?
Jr
Doesn't seem to be :( https://github.com/pypa/pipenv/releases
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
Was this released @techalchemy ? Still seem to be getting this same error when I run pipenv check except mime reads AttributeError: module 'pip' has no attribute 'get_installed_distributions'
@LWanjiru You’re not using --pre. Read the comments.
has it been officially released? @uranusjr
no. Working on 2 small issues before releasing, hoping to release something stable.
cool @techalchemy do let us know when it goes live.
Thank you for the update.
It appears to be in 11.10.1, pipenv check works for me now.
pip install --upgrade pipenv will fix the issue
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. 👍
For those googling, in July 2018:
(While inside a
pipenv shellsession) I ranpip install --upgrade pipas 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. +1
This still works, In march 2019.
Most helpful comment
@techalchemy thanks for the quickfix, can you please release it?