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 fails to start zsh

See original GitHub issue
Issue description

Pipenv fails to start zsh.

Expected result

A zsh subshell.

Actual result

pipenv shell crashes with the following stacktrace.

Launching subshell in virtual environment…
Traceback (most recent call last):
  File "/home/remco/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/home/remco/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/remco/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/remco/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/remco/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/remco/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/remco/.local/lib/python3.6/site-packages/pipenv/cli.py", line 665, in shell
    three=three, python=python, fancy=fancy, shell_args=shell_args, pypi_mirror=pypi_mirror
  File "/home/remco/.local/lib/python3.6/site-packages/pipenv/core.py", line 2163, in do_shell
    shell.fork_compat(*fork_args)
  File "/home/remco/.local/lib/python3.6/site-packages/pipenv/shells.py", line 107, in fork_compat
    self.cmd, ['-i'], dimensions=(dims.lines, dims.columns),
  File "/home/remco/.local/lib/python3.6/site-packages/pipenv/vendor/pexpect/pty_spawn.py", line 204, in __init__
    self._spawn(command, args, preexec_fn, dimensions)
  File "/home/remco/.local/lib/python3.6/site-packages/pipenv/vendor/pexpect/pty_spawn.py", line 276, in _spawn
    'executable: %s.' % self.command)
pipenv.vendor.pexpect.exceptions.ExceptionPexpect: The command was not found or was not executable: -/bin/zsh.

I stepped into choose_shell with a debugger. Apparently type_ is 'zsh', and command is -/bin/zsh.

Steps to replicate

I use Tilix and zsh. It just crashes when I run pipenv shell.

When I run pipenv shell from another TTY, it just works as expected.

Provide the steps to replicate (which usually at least includes the commands and the Pipfile).


$ pipenv --support

Pipenv version: '2018.7.1'

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

Python location: '/usr/bin/python3'

Other Python installations in PATH:

  • 2.7: /usr/bin/python2.7

  • 2.7: /usr/bin/python2.7

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

  • 3.6: /usr/bin/python3.6

  • 2.7.15: /usr/bin/python

  • 2.7.15: /usr/bin/python2

  • 3.6.5: /usr/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.5',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.15.0-22-generic',
 'platform_system': 'Linux',
 'platform_version': '#24-Ubuntu SMP Wed May 16 12:15:17 UTC 2018',
 'python_full_version': '3.6.5',
 'python_version': '3.6',
 'sys_platform': 'linux'}

System environment variables:

  • SESSION_MANAGER
  • XDG_SESSION_ID
  • LC_IDENTIFICATION
  • WINDOWPATH
  • DISPLAY
  • XDG_SEAT
  • DBUS_STARTER_ADDRESS
  • COLORTERM
  • GNOME_DESKTOP_SESSION_ID
  • DEFAULTS_PATH
  • QT_QPA_PLATFORMTHEME
  • LOGNAME
  • TEXTDOMAIN
  • JAVA_HOME
  • LC_TIME
  • SHELL
  • PATH
  • LC_NUMERIC
  • LC_PAPER
  • IM_CONFIG_PHASE
  • TEXTDOMAINDIR
  • CLUTTER_IM_MODULE
  • QT4_IM_MODULE
  • INVOCATION_ID
  • XDG_MENU_PREFIX
  • GNOME_SHELL_SESSION_MODE
  • XAUTHORITY
  • XDG_SESSION_DESKTOP
  • MOZ_USE_OMTC
  • QT_IM_MODULE
  • SSH_AUTH_SOCK
  • LC_MEASUREMENT
  • LC_ADDRESS
  • XMODIFIERS
  • MANDATORY_PATH
  • XDG_CONFIG_DIRS
  • GDMSESSION
  • USERNAME
  • DESKTOP_SESSION
  • XDG_RUNTIME_DIR
  • GTK_IM_MODULE
  • GTK_MODULES
  • USER
  • PWD
  • ANDROID_SDK_ROOT
  • VTE_VERSION
  • LC_MONETARY
  • HOME
  • QT_ACCESSIBILITY
  • SSH_AGENT_PID
  • XDG_DATA_DIRS
  • MANAGERPID
  • LANG
  • LC_NAME
  • GPG_AGENT_INFO
  • SHLVL
  • JOURNAL_STREAM
  • DBUS_STARTER_BUS_TYPE
  • XDG_VTNR
  • TILIX_ID
  • XDG_SESSION_TYPE
  • DBUS_SESSION_BUS_ADDRESS
  • XDG_CURRENT_DESKTOP
  • TERM
  • _
  • LC_TELEPHONE
  • OLDPWD
  • ZSH
  • LESSHISTFILE
  • LESSOPEN
  • PYTHONSTARTUP
  • PAGER
  • LESS
  • LC_CTYPE
  • LSCOLORS
  • LS_COLORS
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/remco/.gem/ruby/2.5.0/bin:/home/remco/.local/share/android-sdk/tools/bin:/home/remco/.local/share/android-sdk/tools:/home/remco/.local/share/android-sdk/platform-tools:/home/remco/.local/share/gradle/bin:/home/remco/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
  • SHELL: /bin/zsh
  • LANG: en_US.UTF-8

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
remcohaszingcommented, Aug 27, 2018

A workaround is to add the following to .zshrc:

export PIPENV_SHELL="$SHELL"
0reactions
uranusjrcommented, Aug 27, 2018

Closing as duplicate

Read more comments on GitHub >

github_iconTop Results From Across the Web

zsh on MacOS: Pipenv shell fails to start asking for password
I am using pipenv on the same machine for 2+ years, and till recently, all worked fine. I can't pinpoint whether there was...
Read more >
Pipenv --version leads to "zsh: command not found
I'm going through the “Python Walkthrough Virtual Enviroments with Pipenv” video. I followed all the steps and they seemed to work until I ......
Read more >
Advanced Usage of Pipenv - Python Packaging Authority
If set, Pipenv does not attempt to install Python with pyenv. Default is to install Python automatically via pyenv when needed, if possible....
Read more >
Pipenv interpreter fails due to bad encoding when oh-my-zsh ...
I can use my pipenv interpreter as the project interpreter. What happens instead? Pipenv throws an error and doesn't set the interpreter.
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 >

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