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 malforms PATH on git bash for windows

See original GitHub issue

On git bash for windows, pipenv shell results in command not found for most commands (python, git, ls, which, etc)

image <Note: I know that python -V says 3.6.3 and the path says 3.6.0; I did an upgrade and never bothered to rename the directory>

Interestingly, in the windows command prompt pipenv shell works as expected. image

I think the problem is in the PATH. Here’s the path before and after pipenv shell

Grunzkes@Pantheon MINGW64 /c/dev/charmspace/iq-api (master)
$ echo $PATH$
/c/Users/Grunzkes/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/Grunzkes/bin:/c/ProgramData/Oracle/Java/javapath:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/apps/python/3.6.0:/c/apps/python/3.6.0/scripts:/c/apps/nodejs/v7.9.0:/c/apps/Yarn/bin:/c/Program Files/gs/gs9.21/bin:/c/Program Files/gs/gs9.21/lib:/c/Users/Grunzkes/AppData/Local/Microsoft/WindowsApps:/c/apps/vs-code/bin:/c/Users/Grunzkes/AppData/Roaming/npm:/c/Users/Grunzkes/AppData/Local/Yarn/bin:/usr/bin/vendor_perl:/usr/bin/core_perl$

Grunzkes@Pantheon MINGW64 /c/dev/charmspace/iq-api (master)
$ pipenv shell

Grunzkes@Pantheon MINGW64 C:/dev/charmspace/iq-api
$ echo $PATH$
C:\Users\Grunzkes\.virtualenvs\iq-api-rSM3q15e\Scripts;C:\Users\Grunzkes\bin;C:\apps\Git\mingw64\bin;C:\apps\Git\usr\local\bin;C:\apps\Git\usr\bin;C:\apps\Git\usr\bin;C:\apps\Git\mingw64\bin;C:\apps\Git\usr\bin;C:\Users\Grunzkes\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\apps\python\3.6.0;C:\apps\python\3.6.0\scripts;C:\apps\nodejs\v7.9.0;C:\apps\Yarn\bin;C:\Program Files\gs\gs9.21\bin;C:\Program Files\gs\gs9.21\lib;C:\Users\Grunzkes\AppData\Local\Microsoft\WindowsApps;C:\apps\vs-code\bin;C:\Users\Grunzkes\AppData\Roaming\npm;C:\Users\Grunzkes\AppData\Local\Yarn\bin;C:\apps\Git\usr\bin\vendor_perl;C:\apps\Git\usr\bin\core_perl$

It appears that the path is being created in a windows format despite being in a bash shell. I say that based on:

  1. The separator changes from : to ; (Unix to Windows)
  2. The paths change from /c/ to C:\

Is there a flag or config to force unix-style PATH in pipenv shell?

Environment
  1. Windows 10
  2. Python 3.6.3
  3. pipenv, version 8.2.7
  4. git version 2.11.0.windows.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
shawnwallcommented, Jun 20, 2018

@erinxocon I would argue that git for windows, and mingwin are actually commonly used for terminal shells in Windows (especially for all of us coming from *nix/mac), and lacking support for it is a real problem.

3reactions
niks-gitcommented, Feb 27, 2018

I also faced similar issue on my GIT bash shell (version 2.7.3). Updating the shell to latest version did not help. What finally worked for me was manually editing the $PATH variable. Here’s what i did:

echo $PATH (Copy the original unix style path)

pipenv shell echo $PATH (Copy the modified portion of the path which is now in Windows style, and paste it upfront of the older path. Make sure you make it unix style compatible)

export PATH=“new-path-created-above”

This worked for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pipenv install/pipenv shell not working with Git Bash on ...
My software versions are: Windows 10 Home 21H1; git version 2.35.1; bash version 4.4.23; Python 3.10.2. Update: So I feel ...
Read more >
pipenv Documentation - Read the Docs
Running Pipenv as root or with sudo (or Admin on Windows) is highly ... Added support for pipenv shell on msys and cygwin/mingw/git...
Read more >
pipenv Documentation
Fixed a bug with the discovery of python paths on Windows which could ... for pipenv shell on msys and cygwin/mingw/git bash for...
Read more >
Install Pipenv on Windows via Windows Powershell or Gitbash
After I installed Python 3 via Gitbash, I also used Windows ... Windows Powershell it asked me to check whether the path is...
Read more >
History | Poetry - Python dependency management and ...
Path dependency metadata is unconditionally re-locked (#6843). ... Fix an issue where poetry shell was broken in git bash on Windows (#6560).
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