Pipenv: Pyenv support broken

Created on 21 Feb 2019  Â·  8Comments  Â·  Source: pypa/pipenv

Be sure to check the existing issues (both open and closed!), and make sure you are running the latest version of Pipenv.

$ pipenv --version
pipenv, version 2018.11.26

Probably related to #3136, however, I can't reopen that.

Issue description

pipenv doesn't find pyenv-python versions.

Expected result

When calling pipenv install pipenv should detect existing versions of Python installed by pyenv. If it doesn't find a Python version as specified in the Pipfile it should start installing the correct Python version via pyenv and then use it to create the virtual environment.

Actual result / Steps to replicate

$ pyenv versions
* system (set by /Users/$USER/.pyenv/version)
  3.5.5
  3.6.5
  3.6.8
$ env|grep PY
PYENV_ROOT=/Users/$USER/.pyenv
$ pipenv --python 3.6
Warning: Python 3.6 was not found on your system…
Would you like us to install CPython 3.6.8 with pyenv? [Y/n]:
Installing CPython 3.6.8 with pyenv (this may take a few minutes)…
âś” Success!

Warning: The Python you just installed is not available on your PATH, apparently.

$ pipenv --support

Pipenv version: '2018.11.26'

Pipenv location: '/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv'

Python location: '/usr/local/Cellar/pipenv/2018.11.26_2/libexec/bin/python3.7'

Python installations found:

  • 3.7.2: /usr/local/bin/python3
  • 3.7.2: /usr/local/bin/python3.7m
  • 2.7.15: /usr/local/bin/python
  • 2.7.15: /usr/local/bin/pythonw
  • 2.7.10: /usr/bin/python
  • 2.7.10: /usr/bin/pythonw
  • 2.7.10: /usr/bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.2',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '18.2.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST '
                     '2018; root:xnu-4903.241.1~1/RELEASE_X86_64',
 'python_full_version': '3.7.2',
 'python_version': '3.7',
 'sys_platform': 'darwin'}

System environment variables:

  • PATH
  • TERM_PROGRAM
  • DOTNET_CLI_TELEMETRY_OPTOUT
  • PYENV_ROOT
  • SHELL
  • TERM
  • HISTSIZE
  • TMPDIR
  • Apple_PubSub_Socket_Render
  • TERM_PROGRAM_VERSION
  • TERM_SESSION_ID
  • LC_ALL
  • OBJC_DISABLE_INITIALIZE_FORK_SAFETY
  • USER
  • HISTFILESIZE
  • COMMAND_MODE
  • SSH_AUTH_SOCK
  • __CF_USER_TEXT_ENCODING
  • _
  • PWD
  • LANG
  • ITERM_PROFILE
  • XPC_FLAGS
  • ITERM_ORIG_PS1
  • XPC_SERVICE_NAME
  • HISTCONTROL
  • COLORFGBG
  • HOME
  • SHLVL
  • ITERM_PREV_PS1
  • ITERM_SESSION_ID
  • LOGNAME
  • LC_CTYPE
  • SECURITYSESSIONID
  • COLORTERM
  • 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: /usr/local/Cellar/pipenv/2018.11.26_2/libexec/tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/local/sbin:/usr/local/opt/go/libexec/bin:/Users/$USER/go/bin:/Users/$USER/.gem/ruby/2.3.0/bin/
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /Users/$USER/dev/myproject

Contents of Pipfile ('/Users/$USER/dev/myproject/Pipfile'):


Most helpful comment

this is resolved in master

you can fix it for now by running pip install -e git+https://github.com/pypa/pipenv.git@master#egg=pipenv

sorry for the frustration and thanks for your patience

All 8 comments

I believe this issue has been reported somewhere and resolved in master branch.

I've rolled back from 2018.11.26 to 2018.7.1 to get around this, I don't think the fix is released yet.

I have the same issue here today.

Is the solution, for now, to roll back to 2018.7.1?

this is resolved in master

you can fix it for now by running pip install -e git+https://github.com/pypa/pipenv.git@master#egg=pipenv

sorry for the frustration and thanks for your patience

I have tried to use the version in master and it is still failing. This is a clean install on a new box:

[ec2-user@ip-172-23-92-180 gp_audit]$ pipenv --version
pipenv, version 2018.11.27.dev0
[ec2-user@ip-172-23-92-180 gp_audit]$ pyenv --version
pyenv 1.2.11
[ec2-user@ip-172-23-92-180 gp_audit]$ pipenv install
Creating a virtualenv for this project...
Pipfile: /home/ec2-user/jenkins/workspace/reports/report-gp-weekly-status-scan/audit/gp_audit/Pipfile
Using /usr/bin/python2.7 (2.7.14) to create virtualenv...
â Ź Creating virtual environment... No LICENSE.txt / LICENSE found in source
New python executable in /home/ec2-user/.local/share/virtualenvs/gp_audit-wSTeOHui/bin/python2.7
Also creating executable in /home/ec2-user/.local/share/virtualenvs/gp_audit-wSTeOHui/bin/python
Installing setuptools, pip, wheel...
done.
Running virtualenv with interpreter /usr/bin/python2.7

âś” Successfully created virtual environment!
Virtualenv location: /home/ec2-user/.local/share/virtualenvs/gp_audit-wSTeOHui
Warning: Your Pipfile requires python_version 3.6, but you are using 2.7.14 (/home/e/.local/share/v/g/bin/python).
$ pipenv --rm and rebuilding the virtual environment may resolve the issue.
$ pipenv check will surely fail.
Installing dependencies from Pipfile.lock (f718cf)...

[ec2-user@ip-172-23-92-180 gp_audit]$ pipenv --support

$ pipenv --support

Pipenv version: '2018.11.27.dev0'

Pipenv location: '/home/ec2-user/src/pipenv/pipenv'

Python location: '/usr/bin/python2'

Python installations found:

  • 2.7.14: /usr/bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.14.109-99.92.amzn2.x86_64',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Mon Apr 1 23:00:38 UTC 2019',
 'python_full_version': '2.7.14',
 'python_version': '2.7',
 'sys_platform': 'linux2'}

System environment variables:

  • PYTHONDONTWRITEBYTECODE
  • LESSOPEN
  • SSH_CLIENT
  • LOGNAME
  • USER
  • HOME
  • PATH
  • PYENV_VIRTUALENV_INIT
  • LANG
  • TERM
  • SHELL
  • PYENV_SHELL
  • SHLVL
  • HISTSIZE
  • PYTHONFINDER_IGNORE_UNSUPPORTED
  • XDG_RUNTIME_DIR
  • PIP_PYTHON_PATH
  • XDG_SESSION_ID
  • _
  • PIPENV_YES
  • SSH_CONNECTION
  • SSH_TTY
  • OLDPWD
  • HOSTNAME
  • HISTCONTROL
  • PWD
  • PIP_SHIMS_BASE_MODULE
  • PIP_DISABLE_PIP_VERSION_CHECK
  • MAIL
  • LS_COLORS

Pipenv–specific environment variables:

  • PIPENV_YES: true

Debug–specific environment variables:

  • PATH: /home/ec2-user/.pyenv/plugins/pyenv-virtualenv/shims:/home/ec2-user/.pyenv/shims:/home/ec2-user/.pyenv/bin:/home/ec2-user/.pyenv/plugins/pyenv-virtualenv/shims:/home/ec2-user/.pyenv/shims:~/.pyenv/bin:/home/ec2-user/.pyenv/plugins/pyenv-virtualenv/shims:/home/ec2-user/.pyenv/shims:~/.pyenv/bin:/home/ec2-user/.pyenv/plugins/pyenv-virtualenv/shims:/home/ec2-user/.pyenv/shims:~/.pyenv/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/ec2-user/.local/bin:/home/ec2-user/bin
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /home/ec2-user/jenkins/workspace/reports/report-gp-weekly-status-scan/audit/gp_audit

Contents of Pipfile ('/home/ec2-user/jenkins/workspace/reports/report-gp-weekly-status-scan/audit/gp_audit/Pipfile'):

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

[dev-packages]

[packages]
boto3 = ">=1.4.0"
Mako = ">=1.0.1"
PyYAML = ">=3.11"
awscli = "*"

[requires]
python_version = "3.6"

Contents of Pipfile.lock ('/home/ec2-user/jenkins/workspace/reports/report-gp-weekly-status-scan/audit/gp_audit/Pipfile.lock'):

{
    "_meta": {
        "hash": {
            "sha256": "75d4488da62043e765ffedf9a54bfee9e1771252427327ec59c56ff26af718cf"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.6"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "awscli": {
            "hashes": [
                "sha256:10cf10b0156f93a1f053fdbb04d5907f19abe160024ddc747c79e32e89dbb5cc",
                "sha256:8a97bbed5ce8055c2f6c1b3a3b5b3118ce7ab8fe1e547c9048535c07d1fa7de5"
            ],
            "index": "pypi",
            "version": "==1.16.122"
        },
        "boto3": {
            "hashes": [
                "sha256:267840eafbf5d7bb83f3eec22a2bd5fe4ffccd6b6497ee583ba5cd4ff5c50bf8",
                "sha256:4e71a7e782280cb038e25bd33ae5acdbbd728bff83b2e2f37f48fb6e4dc6921e"
            ],
            "index": "pypi",
            "version": "==1.9.112"
        },
        "botocore": {
            "hashes": [
                "sha256:7228042b38b15e935dbeba42280e8c3f954eaaeea690d3f612ccdb64feb05f55",
                "sha256:c9e233a22a7512dc43b0b6d70e3f362418994a15613a4350b39b43fd4608edc4"
            ],
            "version": "==1.12.112"
        },
        "colorama": {
            "hashes": [
                "sha256:463f8483208e921368c9f306094eb6f725c6ca42b0f97e313cb5d5512459feda",
                "sha256:48eb22f4f8461b1df5734a074b57042430fb06e1d61bd1e11b078c0fe6d7a1f1"
            ],
            "version": "==0.3.9"
        },
        "docutils": {
            "hashes": [
                "sha256:02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6",
                "sha256:51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274",
                "sha256:7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6"
            ],
            "version": "==0.14"
        },
        "jmespath": {
            "hashes": [
                "sha256:3720a4b1bd659dd2eecad0666459b9788813e032b83e7ba58578e48254e0a0e6",
                "sha256:bde2aef6f44302dfb30320115b17d030798de8c4110e28d5cf6cf91a7a31074c"
            ],
            "version": "==0.9.4"
        },
        "mako": {
            "hashes": [
                "sha256:4e02fde57bd4abb5ec400181e4c314f56ac3e49ba4fb8b0d50bba18cb27d25ae"
            ],
            "index": "pypi",
            "version": "==1.0.7"
        },
        "markupsafe": {
            "hashes": [
                "sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473",
                "sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161",
                "sha256:09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235",
                "sha256:1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5",
                "sha256:24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff",
                "sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b",
                "sha256:43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1",
                "sha256:46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e",
                "sha256:500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183",
                "sha256:535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66",
                "sha256:62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1",
                "sha256:6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1",
                "sha256:717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e",
                "sha256:79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b",
                "sha256:7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905",
                "sha256:88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735",
                "sha256:8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d",
                "sha256:98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e",
                "sha256:9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d",
                "sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c",
                "sha256:ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21",
                "sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2",
                "sha256:b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5",
                "sha256:b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b",
                "sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6",
                "sha256:c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f",
                "sha256:cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f",
                "sha256:e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7"
            ],
            "version": "==1.1.1"
        },
        "pyasn1": {
            "hashes": [
                "sha256:da2420fe13a9452d8ae97a0e478adde1dee153b11ba832a95b223a2ba01c10f7",
                "sha256:da6b43a8c9ae93bc80e2739efb38cc776ba74a886e3e9318d65fe81a8b8a2c6e"
            ],
            "version": "==0.4.5"
        },
        "python-dateutil": {
            "hashes": [
                "sha256:7e6584c74aeed623791615e26efd690f29817a27c73085b78e4bad02493df2fb",
                "sha256:c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e"
            ],
            "markers": "python_version >= '2.7'",
            "version": "==2.8.0"
        },
        "pyyaml": {
            "hashes": [
                "sha256:3d7da3009c0f3e783b2c873687652d83b1bbfd5c88e9813fb7e5b03c0dd3108b",
                "sha256:3ef3092145e9b70e3ddd2c7ad59bdd0252a94dfe3949721633e41344de00a6bf",
                "sha256:40c71b8e076d0550b2e6380bada1f1cd1017b882f7e16f09a65be98e017f211a",
                "sha256:558dd60b890ba8fd982e05941927a3911dc409a63dcb8b634feaa0cda69330d3",
                "sha256:a7c28b45d9f99102fa092bb213aa12e0aaf9a6a1f5e395d36166639c1f96c3a1",
                "sha256:aa7dd4a6a427aed7df6fb7f08a580d68d9b118d90310374716ae90b710280af1",
                "sha256:bc558586e6045763782014934bfaf39d48b8ae85a2713117d16c39864085c613",
                "sha256:d46d7982b62e0729ad0175a9bc7e10a566fc07b224d2c79fafb5e032727eaa04",
                "sha256:d5eef459e30b09f5a098b9cea68bebfeb268697f78d647bd255a085371ac7f3f",
                "sha256:e01d3203230e1786cd91ccfdc8f8454c8069c91bee3962ad93b87a4b2860f537",
                "sha256:e170a9e6fcfd19021dd29845af83bb79236068bf5fd4df3327c1be18182b2531"
            ],
            "index": "pypi",
            "version": "==3.13"
        },
        "rsa": {
            "hashes": [
                "sha256:25df4e10c263fb88b5ace923dd84bf9aa7f5019687b5e55382ffcdb8bede9db5",
                "sha256:43f682fea81c452c98d09fc316aae12de6d30c4b5c84226642cf8f8fd1c93abd"
            ],
            "version": "==3.4.2"
        },
        "s3transfer": {
            "hashes": [
                "sha256:7b9ad3213bff7d357f888e0fab5101b56fa1a0548ee77d121c3a3dbfbef4cb2e",
                "sha256:f23d5cb7d862b104401d9021fc82e5fa0e0cf57b7660a1331425aab0c691d021"
            ],
            "version": "==0.2.0"
        },
        "six": {
            "hashes": [
                "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c",
                "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"
            ],
            "version": "==1.12.0"
        },
        "urllib3": {
            "hashes": [
                "sha256:61bf29cada3fc2fbefad4fdf059ea4bd1b4a86d2b6d15e1c7c0b582b9752fe39",
                "sha256:de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22"
            ],
            "markers": "python_version >= '3.4'",
            "version": "==1.24.1"
        }
    },
    "develop": {}
}

Was this released on a versioned release?

@pecigonzalo there hasn't been a release for almost a year, last release was 2018.11.26, so this is still not fixed in a versioned release.

See #3742

Was this page helpful?
0 / 5 - 0 ratings