Encouragement for virtualenv

The past few days I fell in love with virtualenv. It's a neat way to isolate a python project into a virtual python environment. That makes it easier to develop separate projects with separate library requirements (django 1.0 vs svn for example). You can also provide a simple setup script to pull in all dependencies.

I will definitely use it for my Django game. However I am still uncertain how to support the Windows platform. For one, I intend to host the game on my server. I will publish the source code, and it will include a virtualenv builder. No way to test that in windows, especially since it's a shell script!

(log in to comment)

Comments

virtualenv is really neat but be warned: there are packages that don't interact well with it and either end up installing in the system location or, in the worst cases, just plain failing. In the latter case you can exit the virtualenv and install to the system Python.

BTW, the undocumented magic command for exiting a virtualenv?

deactivate

The number of times I've had to search long and hard to discover that...

Also virtualenv has a tenuous relationship with "pythonw" on OS X which makes it somewhat fun to develop games under.
hm, I can concur, the documentation leaves to be desired. I have found dozens of recipes to use it with Django, and I am mostly stuck with running my own way. It still makes me think a lot more about the environment my programs run under...
If you use virtualenv with a library that has a c-extension, ie. has a compiled .dll in it, then you must remember to configure your setup.py to grab the .dll file and put it into your py2exe executable bundle. I've been using the setup.py 'data_files' parameter to do this, which works, but I notice other messages about 'getting required .dlls' scrolling by while py2exe does its stuff, and am wondering if there's something I've overlooked that I should be using instead?
Actually, what I'm talking about probably applies whether or not virtualenv is in the mix. Ooopsie!
It especially doesn't apply when you don't intend to use py2exe. Maybe I will, but probably I will want my game evaluated as a multiplayer browser game in its public incarnation. Code has to be published of course, and it will run in  a local mode on Linux and Windows, but that is more about rule compliance than about gameplay experience. I haven't ever tried to run py2exe on a Django project anyway. Should not be impossible, though.