I'm following a tutorial called Starting a Django 1.4 Project the Right Way, which gives directions on how to use virtualenv and virtualenvwrapper, among other things.
There's a section that reads:
If you're using pip to install packages (and I can't see why you wouldn't), you can get both virtualenv and virtualenvwrapper by simply installing the latter.
$ pip install virtualenvwrapper
After it's installed, add the following lines to your shell's start-up file (.zshrc, .bashrc, .profile, etc).
export WORKON_HOME=$HOME/.virtualenvs export PROJECT_HOME=$HOME/directory-you-do-development-in source /usr/local/bin/virtualenvwrapper.sh
Reload your start up file (e.g. source .zshrc) and you're ready to go.
I am running Mac OSX, and don't know my way around the Terminal too well. What exactly does the author mean by shell's start-up file (.zshrc, .bashrc, .profile, etc)
? Where do I find this file, so that I can add those three lines?
Also, what does he mean by reload your start up file (e.g. source .zshrc)
?
I would appreciate a detailed response, specific to OSX.
I use an approach that I think is easy to maintain. It also works well if you sometimes use Ubuntu systems, however I will be sure to address the OP's OSX requirement in my answer.
Create a
.aliases
file with your alias(es) in your home directory, e.g.~/.aliases
Execute this file from your
.bashrc
file (this is executed each time for a new shell process) withsource ~/.aliases
. This is all you would actually need to do for Ubuntu btw.On OSX call
.bashrc
from your~/.profile
file, i.e. have~/.bash_profile
contain:source ~/.bashrc
I have Anaconda install, so I add these 3 lines to ~/.bash_profile
and then reload profile by:
You're probably using
bash
so just add these 3 lines to~/.bash_profile
:where
^D
means you type Control+D (EOF).Then either close your terminal window and open a new one, or you can "reload" your
.bash_profile
like this:If you use bash, it usually means
~/.bash_profile
.In Terminal and iTerm new shells are login shells by default, so
~/.bashrc
is not read at all. If instructions written for some other platform tell you to add something to.bashrc
, you often have to add it to.bash_profile
instead.If both
~/.profile
and~/.bash_profile
exist, only.bash_profile
is read..profile
is also read by other shells, but many of the things you'd add to.bash_profile
wouldn't work with them.From /usr/share/doc/bash/bash.html: