LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 08-18-2013, 07:45 PM   #1
elieobeid7
LQ Newbie
 
Registered: Jul 2011
Posts: 21

Rep: Reputation: Disabled
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

Last edited by elieobeid7; 08-18-2013 at 07:47 PM.
 
Old 08-19-2013, 01:00 PM   #2
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,987

Rep: Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555
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.

Last edited by dugan; 08-19-2013 at 01:02 PM.
 
Old 08-19-2013, 01:02 PM   #3
elieobeid7
LQ Newbie
 
Registered: Jul 2011
Posts: 21

Original Poster
Rep: Reputation: Disabled
i have oh-my-zsh installed
 
Old 08-19-2013, 01:19 PM   #4
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,987

Rep: Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555
I know. I've edited my reply.
 
Old 08-19-2013, 01:24 PM   #5
elieobeid7
LQ Newbie
 
Registered: Jul 2011
Posts: 21

Original Poster
Rep: Reputation: Disabled
removed all the plugin, didn't fix it, may i see your .zshrc file? it may be a configuration error

Last edited by elieobeid7; 08-19-2013 at 01:26 PM.
 
Old 08-19-2013, 01:49 PM   #6
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,987

Rep: Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555
Quote:
Originally Posted by elieobeid7 View Post
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

Last edited by dugan; 08-19-2013 at 02:30 PM.
 
Old 08-19-2013, 02:49 PM   #7
elieobeid7
LQ Newbie
 
Registered: Jul 2011
Posts: 21

Original Poster
Rep: Reputation: Disabled
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?

Last edited by elieobeid7; 08-19-2013 at 02:51 PM.
 
Old 08-19-2013, 03:08 PM   #8
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,987

Rep: Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555
I only have this:

Code:
. /usr/bin/virtualenvwrapper.sh
It's probably sourced somewhere else (e.g. in profile.d)
 
Old 08-19-2013, 03:38 PM   #9
elieobeid7
LQ Newbie
 
Registered: Jul 2011
Posts: 21

Original Poster
Rep: Reputation: Disabled
and does

workon somevirtualenv

work for you?
 
Old 08-19-2013, 03:45 PM   #10
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,987

Rep: Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555
Of course.
 
Old 08-19-2013, 04:44 PM   #11
elieobeid7
LQ Newbie
 
Registered: Jul 2011
Posts: 21

Original Poster
Rep: Reputation: Disabled
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
 
  


Reply

Tags
debian, python, virtualenv, zsh


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
New to Python, need some assistance with virtualenv. manwichmakesameal Slackware 2 06-23-2013 11:24 PM
X DISPLAY Connection Problems -current TNWestTex Slackware 1 03-15-2008 08:16 AM
Display current value Gremlin2 Programming 4 10-22-2007 09:21 PM
Display current IP address ust Linux - Software 2 07-25-2007 02:08 PM
how to display the current time at a different timezone stinkytofoo Linux - Software 3 07-18-2007 04:41 AM


All times are GMT -5. The time now is 08:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration