LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to display the name of the current Virtualenv? (https://www.linuxquestions.org/questions/programming-9/how-to-display-the-name-of-the-current-virtualenv-4175473841/)

elieobeid7 08-18-2013 06:45 PM

How to display the name of the current Virtualenv?
 
I'm using virtualenv, virtualenvwrapper, zsh, oh-my-zsh, terminator, on Crunchbang.

I'm trying to display the name of the current virtualenv like so

workon example
(example)...

I've tried many solutions none seems to work, here's my .zshrc file, I know it's no big deal to fix it but I can't find the right solution. It has been a long time since the last time I used Linux for Django development, I forgot what I used to do.

Right now, I see username@crunchbang, I can't tell which virtualenv I'm using.

here's my activate file

I used set -x, this is the output of source activate and this is the output of workon test-env

dugan 08-19-2013 12:00 PM

Code:

plugins=(git colorize debian django virtualenv virtualenvwapper)
In my experience, it doesn't work if you activate both the virtualenv and virtualenvwrapper plugins. Try removing one of the two.

elieobeid7 08-19-2013 12:02 PM

i have oh-my-zsh installed

dugan 08-19-2013 12:19 PM

I know. I've edited my reply.

elieobeid7 08-19-2013 12:24 PM

removed all the plugin, didn't fix it, may i see your .zshrc file? it may be a configuration error

dugan 08-19-2013 12:49 PM

Quote:

Originally Posted by elieobeid7 (Post 5012016)
removed all the plugin, didn't fix it

I assume you mean "I tried removing one, then I tried putting it back and removing the other one".

Here's by .zshrc (comments removed for brevity):

Code:

ZSH=$HOME/.oh-my-zsh
ZSH_THEME="sunrise"
plugins=(django git python virtualenvwrapper)
source $ZSH/oh-my-zsh.sh
export PATH=$PATH:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/java/bin:/usr/lib64/java/jre/bin:/usr/lib64/kde4/libexec:/usr/lib64/qt/bin:/usr/share/texmf/bin:.
export TERM=xterm-256color


elieobeid7 08-19-2013 01:49 PM

how is virtualenv working for you, don't you have to add


Code:

export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true

or is that done within oh-my-zsh virtualenvwrapper plugin?

dugan 08-19-2013 02:08 PM

I only have this:

Code:

. /usr/bin/virtualenvwrapper.sh
It's probably sourced somewhere else (e.g. in profile.d)

elieobeid7 08-19-2013 02:38 PM

and does

workon somevirtualenv

work for you?

dugan 08-19-2013 02:45 PM

Of course.

elieobeid7 08-19-2013 03:44 PM

worked, im speechless but i cant change the themes, well i don't really care about themes, at the very least i got it working and i know that it may have to do with the themes


All times are GMT -5. The time now is 01:05 AM.