News for hackers. Stuff that matters.
Re:OpenBSD won't update Firefox, advises users to switch to ESR by pmontra on Sunday January 12, 2020 @04:05AM (#22025280)
Virtualenv lets you use only a Python interpreter that's already installed on your system. Usually the choice is between the latest v2 and v3 interpreter, at least on Debian derivatives. Every virtualenv is autoupgraded each time the OS upgrades its Pythons.

If you want to use multiple versions of Python and pin them, you should use something like asdf [1] and its Python plugin [2]. It's a version manager with support for many languages and more. I used it for Elixir, Node, PHP, Ruby and even PostgreSQL (I need different database versions in different projects.) I never used it for Python because I'm OK with being on the latest version so far.

With asdf I would expect to do something like this

  asdf install python 3.7.5
  mkdir my375project
  cd my375project
  asdf local python 3.7.5 # pick the version to use here
  python3 -m venv py375 --python=~/.asdf/installs/python/3.7.5/bin/python
  ~/.virtualenvs/py375/bin/activate
This virtualenv is going to stay on 3.7.5 forever.

[1] https://github.com/asdf-vm/asdf

[2] https://github.com/danhper/asdf-python

There are no comments on this comment yet.