Terminal: Where is the shell start-up file?

sgarza62 picture sgarza62 · Feb 27, 2013 · Viewed 48.7k times · Source

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.

Answer

Paul R picture Paul R · Feb 27, 2013

You're probably using bash so just add these 3 lines to ~/.bash_profile:

$ cat >> ~/.bash_profile
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/directory-you-do-development-in
source /usr/local/bin/virtualenvwrapper.sh
^D

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:

$ source ~/.bash_profile