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 shell fails to find /usr/local/bin/bash in pexpect

See original GitHub issue
Issue description

I can’t run pipenv shell. This is different to the other issues related to this issue, since my SHELL variable is correctly configured. It seems to be something pexpect is doing wrong.

Expected result

Successfully running pipenv shell

Actual result
$ pipenv --version
pipenv, version 2018.7.1
$ echo $SHELL
/usr/local/bin/bash
$ stat $SHELL
16777220 8618578105 lrwxr-xr-x 1 keegan admin 0 30 "Jun 15 08:03:49 2018" "Jun 15 08:03:49 2018" "Jun 15 08:03:49 2018" "Jun 15 08:03:49 2018" 4194304 0 0 /usr/local/bin/bash
$ pipenv shell --verbose
Launching subshell in virtual environment…
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/cli.py", line 664, in shell
    three=three, python=python, fancy=fancy, shell_args=shell_args, pypi_mirror=pypi_mirror
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 2163, in do_shell
    shell.fork_compat(*fork_args)
  File "/usr/local/lib/python3.7/site-packages/pipenv/shells.py", line 107, in fork_compat
    self.cmd, ['-i'], dimensions=(dims.lines, dims.columns),
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/pty_spawn.py", line 204, in __init__
    self._spawn(command, args, preexec_fn, dimensions)
  File "/usr/local/lib/python3.7/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: -/usr/local/bin/bash.

Note: /usr/local/bin/bash is a symlink to /usr/local/Cellar/bash/4.4.23/bin/bash (managed by brew). Setting SHELL to that value or /bin/bash both fail.

Steps to replicate

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


$ pipenv --support

Pipenv version: '2018.7.1'

Pipenv location: '/usr/local/lib/python3.7/site-packages/pipenv'

Python location: '/usr/local/opt/python/bin/python3.7'

Other Python installations in PATH:

  • 2.7: /usr/local/bin/python2.7

  • 2.7: /usr/local/bin/python2.7

  • 2.7: /usr/bin/python2.7

  • 3.7: /usr/local/bin/python3.7m

  • 3.7: /usr/local/bin/python3.7

  • 2.7.15: /usr/local/bin/python

  • 2.7.10: /usr/bin/python

  • 2.7.15: /usr/local/bin/python2

  • 3.7.0: /usr/local/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '17.6.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 17.6.0: Tue May  8 15:22:16 PDT '
                     '2018; root:xnu-4570.61.1~1/RELEASE_X86_64',
 'python_full_version': '3.7.0',
 'python_version': '3.7',
 'sys_platform': 'darwin'}

System environment variables:

  • STY
  • SRCPATH
  • MAILCHECK
  • LANG
  • XPC_FLAGS
  • HISTCONTROL
  • OLDPWD
  • TERM_SESSION_ID
  • EDITOR
  • COLORTERM
  • PERL_MB_OPT
  • __CF_USER_TEXT_ENCODING
  • LOCKPRG
  • ITERM_SESSION_ID
  • SSH_AUTH_SOCK
  • USER
  • GOPATH
  • PWD
  • HOME
  • WINDOW
  • TERM_PROGRAM
  • TERM_PROGRAM_VERSION
  • Apple_PubSub_Socket_Render
  • ITERM_PROFILE
  • PERL_MM_OPT
  • TMPDIR
  • PERL_LOCAL_LIB_ROOT
  • XPC_SERVICE_NAME
  • SHELL
  • TERM
  • PERL5LIB
  • COLORFGBG
  • SHLVL
  • LOGNAME
  • GOBIN
  • PATH
  • HISTSIZE
  • HISTFILESIZE
  • TERMCAP
  • _
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /Users/keegan/.cargo/bin:/usr/local/opt/go/libexec/bin:/Users/keegan/bin:/Users/keegan/google-cloud-sdk/bin:/Users/keegan/.yarn/bin:/Users/keegan/perl5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/keegan/.cargo/bin:/usr/local/opt/go/libexec/bin:/Users/keegan/bin:/Users/keegan/google-cloud-sdk/bin:/Users/keegan/.yarn/bin:/Users/keegan/perl5/bin:/Users/keegan/go/bin:/Users/keegan/go/bin
  • SHELL: /usr/local/bin/bash
  • EDITOR: vim
  • LANG: en_GB.UTF-8
  • PWD: /Users/keegan/go/src/github.com/weaveworks/kubediff

Contents of Pipfile (‘/Users/keegan/go/src/github.com/weaveworks/kubediff/Pipfile’):

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

[packages]
attrs = "*"
tabulate = "*"
PyYAML = "*"

[dev-packages]

[requires]
python_version = "3.7"

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

6reactions
Whisprincommented, Jul 17, 2018

Will there be a new release containing the bug fix?

1reaction
mixmastamykcommented, Oct 24, 2018

Is this not fixed yet in the latest on PyPI? Pretty egregious bug for a high-profile project:

⏵ pipenv --version
    pipenv, version 2018.10.13
⏵ pipenv shell
...
pipenv.vendor.pexpect.exceptions.ExceptionPexpect: The command was not found or was not executable: fish.

⏵ python3
>>> from pipenv.shells import _detect_emulator, detect_info
>>> detect_info()
('fish', 'fish')
^D

⏵ env PIPENV_SHELL="$SHELL" pipenv shell
Loading .env environment variables…
Launching subshell in virtual environment…

⏵  source .../dev-TrP3E4Ut/bin/activate.fish
(dev-TrP3E4Ut) ... ⏵

# worked.
Read more comments on GitHub >

github_iconTop Results From Across the Web

pipenv install failing due to timeout - Stack Overflow
It seems like the issue might be that I want it to install the pipenv with python 3.5, but it's using python 3.6?...
Read more >
Pipenv shell start error: FileNotFoundError: [Errno 2] No such ...
i'm trying to use pipenv, installing works, now I wanted to start the shell with pipenv shell and I got the error below....
Read more >
Xonsh - OSCHINA - 中文开源技术交流社区
The mission of xxh is to bring your favorite shell wherever you go through ssh without root access and system installations. If you...
Read more >
[SOLVED] The hard way to debug the mysterious ... - Linux Fixes
So that's the problem. $SHELL is not a full pathname executable so execv() failed to execute it and the error bash: No such...
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