Pipenv: Git PS1 error in pipenv shell

Created on 7 Oct 2017  路  6Comments  路  Source: pypa/pipenv

Hi,

My Problem

When I run the pipenv shell command, the shell works whell but I have this error: bash: __git_ps1: command not found.

Context

I work on MacOS and I use git-prompt to see informations on the current repository in my prompt, like this: repo_name (master *). ls -l (where repo_name (master *). is my prompt and ls -l is a command for the example).

This git-prompt is activated in my ~/.bash_profile like this:

PS1='\[\e[1;34m\]\W\[\e[0m\]$(__git_ps1)\[\e[1;34m\].\[\e[0m\] '

[...]

# Bash Completion
if [ -f $(brew --prefix)/etc/bash_completion ]; then
    source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash
    source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-prompt.sh
fi
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion

Does somebody have an idea to fix that ?
Tanks a lot ! :)

Most helpful comment

@QuentinBrosse did you ever get a resolution for this? Just in case, for me it was simply a case of adding a symlink or my ~/.bash_profile called ~/.bashrc; looks like pipenv/pew only run ~/.bashrc at least initially

All 6 comments

pipenv uses pew to manage virtualenvs.

@QuentinBrosse did you ever get a resolution for this? Just in case, for me it was simply a case of adding a symlink or my ~/.bash_profile called ~/.bashrc; looks like pipenv/pew only run ~/.bashrc at least initially

Any updates? Things work fine for me if I use virtualwrapper to enter the environment instead of pipenv shell.

I have the same issue. I know @kennethreitz closed this issue but he didn't explain why.

Because Pipenv only reads bashrc and that鈥檚 it. Use the above workarounds.

My solution to this was to move .bash_profile to .bashrc and create a new .bash_profile which sources .bashrc if it exists.

See here: https://apple.stackexchange.com/questions/51036/what-is-the-difference-between-bash-profile-and-bashrc

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bgjelstrup picture bgjelstrup  路  3Comments

erinxocon picture erinxocon  路  3Comments

ansrivas picture ansrivas  路  3Comments

jeyraof picture jeyraof  路  3Comments

ipmb picture ipmb  路  3Comments