4 ms·
Beginners Guide : pip and virtualenv
- flexterra 15y agoYou should try virtualenvwrapper, it makes the process of activating and changing between virtualenvs a breeze.
- myusuf3 15y agoupcoming post :P
- stock_toaster 15y agoI liked virtualenvwrapper, but it added considerable (noticable) latency to my terminal startups. I ended up removing it and went back to manual virtualenv activation (with a couple of small helper bash functions of course).
- pyre 15y agoAlso worth mentioning pythonbrew which goes a step further and allows you to manage separate Python builds.
- pdubroy 15y agoOne of the nice things about virtualenv is that it installs a copy of pip into every virtual environment you create. If you always have one of the environments active, there's no need to even install pip globally.
- Pewpewarrows 15y agoExcept for when you DO want to install a package globally. Utilities like pyflakes and fabric, for example.
- pdubroy 15y agoOn my personal machines (effectively single-user), I find there's no need to install packages globally. I have a default virtual environment that I activate in my .profile, and anything that's not project-specific gets installed there. Not saying everyone should do this, but it works well for me.
- myusuf3 15y agothats such a hassle. though, why dont you just install global requirements in the base machine, you wont always have to keep turning on virtualenvs.
- 2mur 15y agoNice article. I use virtualenv heavily and still do the symlinking dance. I keep my django trunk in a ~/libraries folder and symlink the django folder to the /path/to/virtualenv/lib/pythonX.X/site-packages folder. I'm not sure that I have a compelling reason for doing so.
- izak30 15y agocd ~Path/to/django; pip install -e .; It feels better than symlinking to me. I would really only do this if I had a custom patched django though. If speed/bandwidth is a concern, just make sure your pip cache is setup properly.
- myusuf3 15y agoI would suggest to stop doing that since thats the point of virtualenv; it is a bit of pain since it doesn't put django-admin.py in path but you can always refer to it.
- waterside81 15y agopip & virtualenv saved me a world of hurt upgrading from Snow Leopard to Lion. The upgrade completely wiped out any global packages I had in Python/2.6 - so I did lose a few packages that I needed to rebuild, but not many.