Hacker News new | ask | show | jobs
by heavyset_go 2104 days ago
Using virtualenvs is standard practice when developing with Python. What the OP did will work with every standard Python installation out there.

Most Python developers have virtualenv creation done for them via their IDE or scripts that vastly simplify the process so that you don't need to bother with the details in the OP.

1 comments

> .. standard practice .. when developing with Python

development != deployment.

They're standard for deployment, too.
You really don’t want to do that... they can break silently when the system updates Python. Use safe system wide installation for deployment, such as docker or traditional system packages. Alternatively, you can look at one of the many bunglers/static linkers like PyInstaller.
Ideally you'd deploy to a virtualenv in a container, recreating the virtualenv with each new image. You wouldn't update the system Python at all.
> Ideally you'd deploy to a virtualenv in a container

The whole point of a container is to isolate dependencies.

The whole point of a virtualenv is also to isolate dependencies.

If using a container, why bother with a virtualenv at all?