2012-03-01 13 views

risposta

26

È necessario abilitare virtualenvwrapper come descritto in its docs.

Shell Startup File

Add three lines to your shell startup file (.bashrc , .profile , etc.) to set the location where the virtual environments should live, the location of your development project directories, and the location of the script installed with this package:

export WORKON_HOME=$HOME/.virtualenvs 
export PROJECT_HOME=$HOME/Devel 
source /usr/local/bin/virtualenvwrapper.sh 

After editing it, reload the startup file (e.g., run source ~/.bashrc).

3

questo può effettivamente variare un po 'a seconda di come è stato installato. Se lo hai installato su Ubuntu con apt, le funzioni virtualenvwrapper vengono effettivamente inserite in un file di completamento bash (capire che è stato divertente!).

export WORKON_HOME=$HOME/.virtualenvs 
export PROJECT_HOME=$HOME/Devel 
possible_scripts='/usr/local/bin/virtualenvwrapper.sh /etc/bash_completion.d/virtualenvwrapper' 
for script in $possible_scripts; do 
    [[ -f $script ]] && source $script 
done 
Problemi correlati