pipenv: pipenv shell fails using zsh: The command was not found or was not executable

Hello, I’m trying to use pipenv shell but I always get the error The command was not found or was not executable: /tmp/test_pipenv/zsh. I’m using zsh.

Describe your environment
  1. OS Type: Archlinux with kernel 4.13.1
  2. Python version: Python 3.6.3
  3. Pipenv version: 8.3.2
Expected result

Start a new shell with the pipenv environment.

Actual result
 /tmp/test_pipenv  % pipenv install --verbose
Creating a virtualenv for this project…
⠋Using base prefix '/usr'
New python executable in /home/lesell_b/.local/share/virtualenvs/test_pipenv-th_PmQW6/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /home/lesell_b/.local/share/virtualenvs/test_pipenv-th_PmQW6
Creating a Pipfile for this project…
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (c23e27)!                                                                                                                Installing dependencies from Pipfile.lock (c23e27)…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/0 — 00:00:00
To activate this project's virtualenv, run the following:
 $ pipenv shell

 /tmp/test_pipenv  % ls
Pipfile  Pipfile.lock

 /tmp/test_pipenv  % pipenv shell --verbose
Spawning environment shell (/tmp/test_pipenv/zsh). Use 'exit' to leave.
Traceback (most recent call last):
  File "/home/lesell_b/.local/bin/pipenv", line 11, in <module>
    load_entry_point('pipenv==8.3.2', 'console_scripts', 'pipenv')()
  File "/home/lesell_b/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/lesell_b/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/lesell_b/.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/lesell_b/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/lesell_b/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/lesell_b/.local/lib/python3.6/site-packages/pipenv/cli.py", line 2197, in shell
    do_shell(three=three, python=python, fancy=fancy, shell_args=shell_args)
  File "/home/lesell_b/.local/lib/python3.6/site-packages/pipenv/cli.py", line 2125, in do_shell
    terminal_dimensions.columns
  File "/home/lesell_b/.local/lib/python3.6/site-packages/pipenv/vendor/pexpect/pty_spawn.py", line 198, in __init__
    self._spawn(command, args, preexec_fn, dimensions)
  File "/home/lesell_b/.local/lib/python3.6/site-packages/pipenv/vendor/pexpect/pty_spawn.py", line 271, in _spawn
    'executable: %s.' % self.command)
pexpect.exceptions.ExceptionPexpect: The command was not found or was not executable: /tmp/test_pipenv/zsh.
Steps to replicate

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

$ # Using zsh
$ mkdir test_pipenv
$ cd test_pipenv
$ pipenv install
$ pipenv shell

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (4 by maintainers)

Commits related to this issue

Most upvoted comments

I did the classic install and then re-install with homebrew and it worked marvelously.

brew uninstall pipenv
brew install pipenv

@sallybananas Just add export SHELL=/bin/zsh into your .zshrc, open a new shell, and try pipenv shell again

I’ve found my issue, I had the SHELL env variable to zsh and not /bin/zsh. I always thought that was enough, and never had any issues with software using it.

Maybe it would be interesting to add a note about that in the README ?

This still doesn’t work for me. SHELL is set to /usr/bin/zsh, and still getting the error above.