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 not finding /usr/bin/env bash

See original GitHub issue

Be sure to check the existing issues (both open and closed!).

Describe the issue briefly here.

When running pipenv shell on latest version the following happens:

/usr/bin/env: ‘bash’: No such file or directory
bash: tput: command not found
bash: tput: command not found
bash: tput: command not found
bash: tput: command not found
bash: tput: command not found
bash: tput: command not found
bash: tput: command not found
bash: tput: command not found
bash: tput: command not found
┌── [01:14:01] [tristan957@c-3po] [~/Projects/digit-al-tunes]
└─‖ . /home/tristan957/.local/share/virtualenvs/digit-al-tunes-Br68lvpa/bin/activate
bash: basename: command not found
bash: tput: command not found
bash: tput: command not found
bash: tput: command not found
bash: tput: command not found
bash: tput: command not found
bash: tput: command not found
bash: tput: command not found
bash: tput: command not found
bash: tput: command not found
() ┌── [01:14:01] [tristan957@c-3po] [~/Projects/digit-al-tunes]
└─‖ 

Please run $ python -m pipenv.help, and paste the results here.

$ python -m pipenv.help output

Pipenv version: '11.10.0'

Pipenv location: '/home/tristan957/.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.14: /usr/bin/python

  • 2.7.14: /usr/bin/python2

  • 3.6.4: /usr/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.4',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.15.15-63.current',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP PREEMPT Sat Apr 7 08:32:34 UTC 2018',
 'python_full_version': '3.6.4',
 'python_version': '3.6',
 'sys_platform': 'linux'}

System environment variables:

  • LS_COLORS
  • XDG_MENU_PREFIX
  • LANG
  • HISTIGNORE
  • HISTCONTROL
  • MANAGERPID
  • DISPLAY
  • INVOCATION_ID
  • EDITOR
  • COLORTERM
  • XDG_VTNR
  • SSH_AUTH_SOCK
  • XDG_SESSION_ID
  • XDG_GREETER_DATA_DIR
  • USER
  • DESKTOP_SESSION
  • GOPATH
  • QT_QPA_PLATFORMTHEME
  • INPUTRC
  • PWD
  • HOME
  • JOURNAL_STREAM
  • GIT_PS1_SHOWDIRTYSTATE
  • XDG_SESSION_TYPE
  • XDG_DATA_DIRS
  • XDG_SESSION_DESKTOP
  • TILIX_ID
  • DBUS_STARTER_ADDRESS
  • GTK_MODULES
  • TERM
  • SHELL
  • VTE_VERSION
  • GNOME_KEYRING_CONTROL
  • XDG_SEAT_PATH
  • QT_IM_MODULE
  • XMODIFIERS
  • DBUS_STARTER_BUS_TYPE
  • XDG_CURRENT_DESKTOP
  • XDG_SEAT
  • SHLVL
  • JENV_LOADED
  • GDMSESSION
  • GNOME_DESKTOP_SESSION_ID
  • LOGNAME
  • DBUS_SESSION_BUS_ADDRESS
  • XDG_RUNTIME_DIR
  • XAUTHORITY
  • XDG_SESSION_PATH
  • XDG_CONFIG_DIRS
  • PATH
  • PS1
  • PS3
  • PS2
  • PS4
  • HISTSIZE
  • SESSION_MANAGER
  • _
  • OLDPWD
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH
  • PYTHONUNBUFFERED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/tristan957/.jenv/shims:/sbin:/bin:/usr/sbin:/usr/bin:/snap/bin:/home/tristan957/go/bin:/home/tristan957/.jenv/bin:/home/tristan957/.local/bin:/home/tristan957/.cargo/bin:/home/tristan957/.yarn/bin
  • SHELL: /bin/bash
  • EDITOR: vim
  • LANG: en_US.utf8
  • PWD: /home/tristan957/Projects/digit-al-tunes

Contents of Pipfile (‘/home/tristan957/Projects/digit-al-tunes/Pipfile’):

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

[packages]
PyGObject = "*"
pydocstyle = "*"
pyserial = "*"

[dev-packages]
"flake8" = "*"

[requires]
python_version = "3.6"

Contents of Pipfile.lock (‘/home/tristan957/Projects/digit-al-tunes/Pipfile.lock’):

{
    "_meta": {
        "hash": {
            "sha256": "d03ba088eb2cc3d1b721d27e6f23b4ca1866c965d5495a631970740897eb09e1"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.6"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.python.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "pycairo": {
            "hashes": [
                "sha256:5bb321e5d4f8b3a51f56fc6a35c143f1b72ce0d748b43d8b623596e8215f01f7"
            ],
            "version": "==1.16.3"
        },
        "pydocstyle": {
            "hashes": [
                "sha256:08a870edc94508264ed90510db466c6357c7192e0e866561d740624a8fc7d90c",
                "sha256:4d5bcde961107873bae621f3d580c3e35a426d3687ffc6f8fb356f6628da5a97",
                "sha256:af9fcccb303899b83bec82dc9a1d56c60fc369973223a5e80c3dfa9bdf984405"
            ],
            "index": "pypi",
            "version": "==2.1.1"
        },
        "pygobject": {
            "hashes": [
                "sha256:f704f4be3b4ae3cae70acf82ac64a8c7c44d3acad2d33e9849056ac317345f5e"
            ],
            "index": "pypi",
            "version": "==3.28.2"
        },
        "pyserial": {
            "hashes": [
                "sha256:6e2d401fdee0eab996cf734e67773a0143b932772ca8b42451440cfed942c627",
                "sha256:e0770fadba80c31013896c7e6ef703f72e7834965954a78e71a3049488d4d7d8"
            ],
            "index": "pypi",
            "version": "==3.4"
        },
        "six": {
            "hashes": [
                "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9",
                "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb"
            ],
            "version": "==1.11.0"
        },
        "snowballstemmer": {
            "hashes": [
                "sha256:919f26a68b2c17a7634da993d91339e288964f93c274f1343e3bbbe2096e1128",
                "sha256:9f3bcd3c401c3e862ec0ebe6d2c069ebc012ce142cce209c098ccb5b09136e89"
            ],
            "version": "==1.2.1"
        }
    },
    "develop": {
        "flake8": {
            "hashes": [
                "sha256:7253265f7abd8b313e3892944044a365e3f4ac3fcdcfb4298f55ee9ddf188ba0",
                "sha256:c7841163e2b576d435799169b78703ad6ac1bbb0f199994fc05f700b2a90ea37"
            ],
            "index": "pypi",
            "version": "==3.5.0"
        },
        "mccabe": {
            "hashes": [
                "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42",
                "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"
            ],
            "version": "==0.6.1"
        },
        "pycodestyle": {
            "hashes": [
                "sha256:1ec08a51c901dfe44921576ed6e4c1f5b7ecbad403f871397feedb5eb8e4fa14",
                "sha256:5ff2fbcbab997895ba9ead77e1b38b3ebc2e5c3b8a6194ef918666e4c790a00e",
                "sha256:682256a5b318149ca0d2a9185d365d8864a768a28db66a84a2ea946bcc426766",
                "sha256:6c4245ade1edfad79c3446fadfc96b0de2759662dc29d07d80a6f27ad1ca6ba9"
            ],
            "version": "==2.3.1"
        },
        "pyflakes": {
            "hashes": [
                "sha256:08bd6a50edf8cffa9fa09a463063c425ecaaf10d1eb0335a7e8b1401aef89e6f",
                "sha256:8d616a382f243dbf19b54743f280b80198be0bca3a5396f1d2e1fca6223e8805"
            ],
            "version": "==1.6.0"
        }
    }
}


Expected result

Not get bash errors

Actual result

When possible, provide the verbose output (--verbose), especially for locking and dependencies resolving issues.

Steps to replicate

Pipfile

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

[packages]
PyGObject = "*"
pydocstyle = "*"
pyserial = "*"

[dev-packages]
"flake8" = "*"

[requires]
python_version = "3.6"

Include a tput command in your bashrc (PS1). Watch the magic happen.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:38 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
tristan957commented, May 1, 2018

I have found the error! I was exporting PATH in my .env file because I was under the impression the virtualenv bin did not get added to PATH. I deleted my .env file and the issue has been resolved.

1reaction
Nate-Wilkinscommented, Aug 27, 2018

@kepler thanks! That saved me some time. I was using dotenv for zsh which sources my .env file. This was causing similar issues where I would get No such file or directory issues regarding my $PATH environment variable that happened to be exported in my .env file.

Long story short it’s some sort of PATH issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Pipenv: Command Not Found - Stack Overflow
1. Check /usr/local/bin/pipenv — is it there? · 4. Same problem here: succesfully built pipenv but no sign of pipenv folder in /usr/local/bin...
Read more >
Solving `command not found: pipenv` - Koen Woortman
Most likely you installed pipenv with pip( pip install pipenv ) without having the directory where pip installs local dependencies in your PATH....
Read more >
Frequently Encountered Pipenv Problems - Read the Docs
☤ My pyenv-installed Python is not found​​ Make sure you have PYENV_ROOT set correctly. Pipenv only supports CPython distributions, with version name like...
Read more >
Configure a Pipenv environment | IntelliJ IDEA Documentation
Run the following command to find the user base's binary directory: $ python -m site --user-base · Add bin to this path to...
Read more >
Basic Usage of Pipenv - Python Packaging Authority
Shells are typically misconfigured for subshell use, so $ pipenv shell --fancy may produce unexpected results. If this is the case, try $...
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