Update: You’ll probably want to use the pip script installer aka. pipsi instead of this method, although pipsi does have some drawbacks.
In line with the post from yesterday, I thought I’d share a nifty trick that I’ve been using for a while. I set up a virtual environment in my home directory, and symlink the applications to /usr/local/bin/
.
Actually, that’s a lie. I’m lazy, so I add the bin/
directory to $PATH
. Warning: If you do this, you need to make absolutely sure that you set the order to match the behaviour you want. “Unexpected” things happen if you add it to the front of $PATH
and you then forget that pip
and python
now constantly point to the virtualenv. But maybe, that’s what you want? It actually works fine (not a guarantee :P).
There is a drawback: If installed via a package manager, tools will get updated via that method also. With a virtualenv, you have to remember to update it yourself.
Total separation from the OS is a pretty big bonus though. It’s easy to install specific versions, and if I update or mess with the site packages, nothing the system relies on will fall over. Since I found myself not using the tools in the long term LTS repositories because they’re out of date, this works well for me.
(Now you can also see why making projects into wheels is so useful: clean installation in any virtualenv.)