Simon Willison’s Weblog

Subscribe
Atom feed for virtualenv

5 items tagged “virtualenv”

2024

Why I Still Use Python Virtual Environments in Docker (via) Hynek Schlawack argues for using virtual environments even when running Python applications in a Docker container. This argument was most convincing to me:

I'm responsible for dozens of services, so I appreciate the consistency of knowing that everything I'm deploying is in /app, and if it's a Python application, I know it's a virtual environment, and if I run /app/bin/python, I get the virtual environment's Python with my application ready to be imported and run.

Also:

It’s good to use the same tools and primitives in development and in production.

Also worth a look: Hynek's guide to Production-ready Docker Containers with uv, an actively maintained guide that aims to reflect ongoing changes made to uv itself.

# 2nd September 2024, 11:57 pm / docker, python, hynek-schlawack, uv, virtualenv, packaging

2018

import-pypi. A devious Python 3 hack which abuses importlib.machinery to add a hook such that any time you type “import modulename” it checks to see if the module is installed and runs “pip install modulename” first if it isn’t. Intended as a joke, but if you habitually fire up temporary virtual environments for exploratory programming like I do this could actually be a neat little time-saver.

# 29th March 2018, 10:16 pm / virtualenv, pypi, python

2009

Fabric, Django, Git, Apache, mod_wsgi, virtualenv and pip deployment. I’m slowly working my way through this stack at the moment—next stop, fabric.

# 28th July 2009, 11:56 am / fabric, virtualenv, django, python, git, apache, modwsgi, gareth-rushgrove, pip, deployment

Tools of the Modern Python Hacker: Virtualenv, Fabric and Pip. Ashamed to say I’m not using any of these yet—for Django projects, my manage.py inserts an “ext” directory at the beginning of the Python path which contains my dependencies for that project.

# 9th July 2009, 11:40 am / python, tools, django, virtualenv, fabric, pip, deployment, pythonpath

2007

virtualenv 0.8.1. Ian Bicking’s tool for creating isolated Python environments; designed to replace his earlier workingenv package. Does anyone have any experience using this? It looks fantastically useful.

# 15th September 2007, 11:36 pm / python, virtualenv, ian-bicking