Pipenv: terminal prompt doesn't show you're in the venv

Created on 13 Mar 2017  路  7Comments  路  Source: pypa/pipenv

I'm on OS X Sierra running pipenv 3.5.2. Everything seems to work correctly. But when dropping into shell:pipenv shell I get Launching subshell in virtual environment... However the terminal prompt doesn't change to show I'm in the virtual environment - looks like my normal terminal prompt. Examples I see in the doc, look like the prompt should change as it does in virtualenvironment. Is there a configuration setting I'm missing? Thanks

Most helpful comment

If that doesn't work, pipenv shell -c should fix your issue. This appears to be a dupe of a conflict we've previously found with pew.

All 7 comments

Hey @davebryson, are you using a shell other than the standard bash configuration provided on Sierra? When you're in the pipenv shell can you tell me what the value of $WORKSPACE is? Thanks!

I'm using Bash. I've customized PS1 and LDCOLORS in my .bash_profile. Running echo $WORKSPACE from within the pipenv shell returns nothing - no output. Before trying pipenv I had been using virtualenv with the same shell and it would alway show the proper virtualenv ok.

Ok, one more test for me if you wouldn't mind. Could you tell me if pew workon <virtualenv-name> does anything to your prompt? pipenv --venv will give you the path to your actual virtualenv and you'll need to use the directory name after the final / for <virtualenv-name>.

e.g. pew workon myProject-FwtTidye

If that doesn't work, pipenv shell -c should fix your issue. This appears to be a dupe of a conflict we've previously found with pew.

Starting from a fresh terminal I ran pew workon sample-m7t5mATO where sample-m7t5mATO is the virtualenv-name created by pipenv. It does not change my prompt to show the virtualenv and outputs:
Launching subshell in virtual environment. Type exit or ctrl-D to return
Be aware that this environment will be nested on top of sample-m7t5mATO

But yes pipenv shell -c works as expected!

Ok great, I'll leave a link to berdario/pew#77 here which has instructions for configuring your shell to work with pew. I'm not necessarily recommending this, but rather leaving this here as an FYI for future readers. Pipenv uses pew by default and is subject to how they handle terminal interactions. pipenv shell -c bypasses pew here, but that also means you lose some of the advantages of pew.

Choose whichever option fits your needs best 馃槉. Glad you have things working now @davebryson!

Thanks for the quick response and great work on pipenv!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ipmb picture ipmb  路  3Comments

hynek picture hynek  路  3Comments

jeyraof picture jeyraof  路  3Comments

erinxocon picture erinxocon  路  3Comments

leileigong picture leileigong  路  3Comments