virtualenvs or: How I Learned to Stop Worrying and Love not having sudo powers in a server

Author
Published

January 28, 2015

Well, you might think, there is always pip install --user. Aha! Yes, that works most of the time, but not when some package upgrade (distribute for deepTools) conflicts with globally installed packages.

The solution (for python packages)

Python virtualenvs to the rescue!

These have been around for sometime, but I never felt inclined to dig into it until now (I can also be a bit of a Luddite). Put simply, virtualenvs are reservoirs of custom python and package installations. In practice, one creates a folder where all the packages can be installed, and then simply source it. From that point on, everythying done in python is using whathever is in that folder or virtualenv. Even a copy of the python binary will be there.

One of the major appeals, for me at least, is that no sudo is required for the set-up of the virtualenv or installation of packages. Also, one can have multiple virtualenvs, say for different projects.

For a proper (practical tutorial) see this post by Jamie Mathews.

In the meantime, deepTools just finished compiling and I can now go to work.

Reuse

Citation

BibTeX citation:
@online{domingues2015,
  author = {Domingues, António},
  title = {Virtualenvs or: {How} {I} {Learned} to {Stop} {Worrying} and
    {Love} Not Having Sudo Powers in a Server},
  date = {2015-01-28},
  url = {https://amjdomingues.com/posts/2015-01-28-virtualenvs-or-how-i-learned-to-stop-worrying-and-love-not-having-sudo-powers-in-a-server/},
  langid = {en}
}
For attribution, please cite this work as:
Domingues, António. 2015. “Virtualenvs or: How I Learned to Stop Worrying and Love Not Having Sudo Powers in a Server.” January 28, 2015. https://amjdomingues.com/posts/2015-01-28-virtualenvs-or-how-i-learned-to-stop-worrying-and-love-not-having-sudo-powers-in-a-server/.