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.

Pyenv and Python 3.4.* not installing

See original GitHub issue

Issue description

Using pyenv 1.2.7 and pipenv 2018.10.13 I cannot install any variant of Python 3.4 without a stack trace. I have tested it with Python 3.5., 3.6., and 3.7.* and all of those versions work just fine.

Expected result

pipenv --python 3.4.9 correctly installs Python 3.4 with pyenv and the environment functions as expected.

Actual result

A stack trace is thrown from the pipenv code

Steps to replicate

Operating System: Fedora 27 on a desktop

  1. Install pyenv and pipenv as usual, setting up all necessary env variables. (I know these work since pipenv handles all other supported versions of Python 3 just fine
  2. run the command pipenv --install python 3.4
  3. Will be prompted to have pyenv install Python 3.4.9. Accept.

Stack trace

[18:09:41] megger:~ $ pipenv --python 3.4
Warning: Python 3.4 was not found on your system…
Would you like us to install CPython 3.4.9 with pyenv? [Y/n]: y
Installing CPython 3.4.9 with pyenv (this may take a few minutes)…
Traceback (most recent call last):
  File "/home/megger/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/home/megger/.local/pipx/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/megger/.local/pipx/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/megger/.local/pipx/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1114, in invoke
    return Command.invoke(self, ctx)
  File "/home/megger/.local/pipx/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/megger/.local/pipx/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/megger/.local/pipx/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/megger/.local/pipx/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/megger/.local/pipx/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/megger/.local/pipx/venvs/pipenv/lib64/python3.6/site-packages/pipenv/cli/command.py", line 203, in cli
    clear=state.clear,
  File "/home/megger/.local/pipx/venvs/pipenv/lib64/python3.6/site-packages/pipenv/core.py", line 565, in ensure_project
    pypi_mirror=pypi_mirror,
  File "/home/megger/.local/pipx/venvs/pipenv/lib64/python3.6/site-packages/pipenv/core.py", line 488, in ensure_virtualenv
    python = ensure_python(three=three, python=python)
  File "/home/megger/.local/pipx/venvs/pipenv/lib64/python3.6/site-packages/pipenv/core.py", line 451, in ensure_python
    c = pyenv.install(version)
  File "/home/megger/.local/pipx/venvs/pipenv/lib64/python3.6/site-packages/pipenv/pyenv.py", line 117, in install
    timeout=PIPENV_INSTALL_TIMEOUT,
  File "/home/megger/.local/pipx/venvs/pipenv/lib64/python3.6/site-packages/pipenv/pyenv.py", line 73, in _pyenv
    raise PyenvError('faild to run {0}'.format(args), c)
  File "/home/megger/.local/pipx/venvs/pipenv/lib64/python3.6/site-packages/pipenv/pyenv.py", line 56, in __init__
    self.err = c.err
  File "/home/megger/.local/pipx/venvs/pipenv/lib64/python3.6/site-packages/pipenv/vendor/delegator.py", line 146, in err
    return self._pexpect_out
  File "/home/megger/.local/pipx/venvs/pipenv/lib64/python3.6/site-packages/pipenv/vendor/delegator.py", line 114, in _pexpect_out
    result += self.subprocess.after
TypeError: must be str, not type

$ pipenv --support

Pipenv version: '2018.10.13'

Pipenv location: '/home/megger/.local/pipx/venvs/pipenv/lib64/python3.6/site-packages/pipenv'

Python location: '/home/megger/.local/pipx/venvs/pipenv/bin/python3'

Python installations found:

  • 3.7.1: /home/megger/.pyenv/versions/3.7.1/bin/python3.7
  • 3.7.1: /home/megger/.pyenv/versions/3.7.1/bin/python3.7m
  • 3.6.6: /home/megger/.pyenv/shims/python3
  • 3.6.6: /usr/bin/python3.6m
  • 3.6.6: /usr/bin/python3.6
  • 3.5.6: /home/megger/.pyenv/versions/3.5.6/bin/python3.5
  • 3.5.6: /home/megger/.pyenv/versions/3.5.6/bin/python3.5m
  • 2.7.15: /home/megger/.pyenv/shims/python
  • 2.7.15: /usr/bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.6',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.18.16-100.fc27.x86_64',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Sun Oct 21 09:33:00 UTC 2018',
 'python_full_version': '3.6.6',
 'python_version': '3.6',
 'sys_platform': 'linux'}

System environment variables:

  • XDG_MENU_PREFIX
  • BYOBU_ULIMIT
  • LANG
  • GDM_LANG
  • HISTCONTROL
  • _VIRTUALENVWRAPPER_API
  • DISPLAY
  • HOSTNAME
  • BYOBU_CONFIG_DIR
  • OLDPWD
  • BYOBU_DARK
  • BYOBU_LIGHT
  • COLORTERM
  • USERNAME
  • XDG_VTNR
  • SSH_AUTH_SOCK
  • BYOBU_PREFIX
  • XDG_SESSION_ID
  • BYOBU_TTY
  • USER
  • DESKTOP_SESSION
  • BYOBU_TERM
  • BYOBU_HIGHLIGHT
  • WAYLAND_DISPLAY
  • BYOBU_DISTRO
  • PWD
  • HOME
  • BYOBU_PAGER
  • JOURNAL_STREAM
  • TMUX
  • XDG_SESSION_TYPE
  • XDG_DATA_DIRS
  • BYOBU_DATE
  • BYOBU_PYTHON
  • BYOBU_CHARMAP
  • XDG_SESSION_DESKTOP
  • GJS_DEBUG_OUTPUT
  • BYOBU_READLINK
  • LOADEDMODULES
  • MAIL
  • BYOBU_WINDOW_NAME
  • VIRTUALENVWRAPPER_SCRIPT
  • VTE_VERSION
  • TERM
  • SHELL
  • BYOBU_SED
  • QT_IM_MODULE
  • XMODIFIERS
  • XDG_CURRENT_DESKTOP
  • BYOBU_BACKEND
  • TMUX_PANE
  • XDG_SEAT
  • SHLVL
  • BYOBU_ACCENT
  • BYOBU_TIME
  • BYOBU_RUN_DIR
  • MODULEPATH
  • GDMSESSION
  • GNOME_DESKTOP_SESSION_ID
  • LOGNAME
  • DBUS_SESSION_BUS_ADDRESS
  • XDG_RUNTIME_DIR
  • PATH
  • MODULESHOME
  • HISTSIZE
  • GJS_DEBUG_TOPICS
  • SESSION_MANAGER
  • LESSOPEN
  • LS_COLORS
  • ZSH
  • WORKON_HOME
  • PAGER
  • LESS
  • LC_CTYPE
  • LSCOLORS
  • PYENV_SHELL
  • PYENV_VIRTUALENV_INIT
  • _
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PIPENV_ACTIVE
  • PS1
  • PYENV_ROOT

Pipenv–specific environment variables:

  • PIPENV_ACTIVE: 1

Debug–specific environment variables:

  • PATH: /home/megger/.pyenv/plugins/pyenv-virtualenv/shims:/home/megger/.pyenv/shims:/home/megger/.pyenv/bin:/home/megger/.local/bin:/home/megger/.pyenv/plugins/pyenv-virtualenv/shims:/home/megger/.pyenv/shims:/home/megger/.pyenv/bin:/home/megger/.local/bin:/home/megger/.pyenv/plugins/pyenv-virtualenv/shims:/home/megger/.pyenv/shims:/home/megger/.pyenv/bin:/home/megger/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/megger/bin
  • SHELL: /usr/bin/zsh
  • LANG: en_US.UTF-8
  • PWD: /home/megger

Contents of Pipfile (‘/home/megger/Pipfile’):


Issue Analytics

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

github_iconTop GitHub Comments

1reaction
asmaiercommented, Oct 30, 2018

I couldn’t find a workaround for issue #3123 . So my steps how I got Python 3.6.5 working with pipenv and pyenv were

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
pyenv install 3.6.5
pipenv install --python ~/.pyenv/versions/3.6.5/bin/python
0reactions
techalchemycommented, Nov 4, 2018

between #3159 and #3161 I believe this is covered now, sorry for the bug!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to install python 3.4.10 with pyenv · Issue #1705 - GitHub
I am not able to install python 3.4.10 with pyenv, but I can install other versions. Below is the list of versions I...
Read more >
Installing Python 3 and Pyenv on MacOS, Windows, and Linux
Installing Python 3 and Pyenv on MacOS, Windows, and Linux · Check for already installed python versions · Install Pyenv · Use pyenv...
Read more >
Install python 3.7, 3.6, 3.5, and 3.4 on BigSure with pyenv
This post is about installing python 3.5, 3.6, and 3.7 since my previous post only supports python 3.8 and 3.9.
Read more >
Pyenv: Not able to install python 3.x version MacOS 12.3.1
I am not able to I have tried to install different version of python3.9.X (3.9.8, 3.9.9, 3.9.10, 3.9.11) and none of them are...
Read more >
Using pyenv to Install Python
Now that you've installed pyenv, installing a specific version of Python is ... Python versions, you can run the command pyenv install --list....
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