Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Setting Up a Local Python Environment Installing Python and Python Libraries Locally Using virtualenv

Santiago Srz
Santiago Srz
6,631 Points

Can someone please explain how to find the path for the virtual env on a MAC?

I don't know how to find the path for the virtual env. Kenneth only explains how to find his. How do I find mine!? Thank You Guys!

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,457 Points

HI! When you create an environment with virtualenv <dir>, the environment is created in the current working directory. For example:

$ virtualenv Env
New python executable in Env/bin/python
Installing setuptools, pip...done.

$ ls
Env

# activate Env 
$ . Env/bin/activate

# prompt will not be preceded with "(Env)" to remind you the environment is active
(Env) $ 

# to leave the environment use "deactivate"
(Env) $ deactivate
$

Some people manually manage their "Env" directories by placing them all in a directory under their home directory. When you're ready, checkout the tool virtualenvwrapper and its command mkvirtualenv. It manages all of your Envs for you and gives you name-completion on the commandline, if needed.