I have a problem that comes from me following tutorials without really understanding what I’m doing. The root of the problem I think is the fact that I don’t understand how the OS X filesystem works.
The problem is bigger than Python but it was when I started learning about Python that I realized how little I really understand. So in the beginning I started following tutorials which led me to use the easy_install command a lot and when a lot of tutorials recommended PIP I never got it running. So I have run a lot of commands and installed a lot of different packages.
As I have understood Lion comes with a python install. I have been using this a lot and from this I have installed various packages with easy_install. Is there any way to go back to default installation and begin from the very beginning? Is this something I want to do? If so why?
Is there any advantage of using a Python version I have installed with Homebrew? How can I see from where Python is run when I run the Python command?
When I do install something with either easy_install, homebrew, macports etc where do things actually end up?
Homebrew installs its software inside the
/usr/localsubdirectory on your Mac. OS X doesn’t install anything there on its own; in fact,/usr/localis reserved for user-installed stuff. Since Homebrew never installs files outside/usr/local(and doesn’t even have the ability to, unless you runbrewusingsudo– which is not recommended_) and OS X never installs files inside there, never the two shall mix.easy_installandpipinstall files into system directories by default. That’s why you have to run those commands withsudoto install packages with them.I can’t recommend virtualenv enough, regardless of which OS you’re using. It installs a copy of Python, along with any packages or modules you want, inside a directory of your choosing. For example:
…and all traces of the project are now completely gone.
Use
easy_installto install virtualenv into OS X itself – like you’ve done for those other packages – but then do all new development inside isolated directories that you can wipe clean at a moment’s notice. This is pretty much the standard way of developing and deploying Python applications these days.