Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm planning to set up a Python app (Pyblosxom) on my server and considering to run it in its own virtualenv sandbox with --no-site-packages. I'm hoping that such a setup would be easily portable and maintainable over the years.

However, I've only used virtualenv for development environments that recreate a certain server setup locally, and most sources about virtualenv seem to also mention virtualenv for such a use.

Is there any drawback to running a Python app from a virtualenv on a live server?

NOTE: As for the portability of the setup, I've just been made aware of the experimental --relocatable option which needs to be ran after new package installs. Even if I didn't do this though, I guess the setup would be quite portable thanks to pip.

share|improve this question
up vote 13 down vote accepted

Yes, a virtualenv is quite suitable for production -- we have (very) large Python-using customers running their apps inside of a virtualenv, and it works very well to keep them isolated from the system Python configuration.

However, I wouldn't recommend using it for "portability" -- trying to transport the whole thing from machine to machine. There's far too much opportunity for subtle failures due to incompatibilities nobody else is going to notice (because it's not something that's widely done). Instead, have automation which is capable of setting up a new virtualenv matching your requirements on a new machine.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.