1

My suspicion is that this was already asked somewhere, but there are a lot of similarly phrased but not the same questions out there. Please forgive me.

I am supporting a number of python projects that are running various 2.7.x versions. I'd like to start taking advantage of virtualenv or something similar to make sandboxes on my workstation (ubuntu). The command mkvirtualenv for virtualenvwrapper requires the executable for the version after the -p parameter. It looks like this assumes that the python version was already installed.

Question: Do I have to manually install all of the different 2.7.x python versions in /usr/bin/ side-by-side?

Call me lazy, but I was hoping that the tool had something like a package manager that would download the python version along with whatever else was in the requirements file. If you're reading this and thinking "this exists, but virtualenvwrapper doesn't have it" feel free to drop the name of the tool in your response.

MrGoodfix
  • 317
  • 2
  • 14
  • There's a whole zoo of "virtual environment managers" for python, some of which are mentioned here https://stackoverflow.com/a/41573588/3791466. I used to use virtualenv(wrapper) but it has little to no support for having multiple minor versions of python so I gradually migrated to conda. It also happens to be much more user friendly and provide "better isolation". I suggest that you also consider docker if you are doing this for production. – Hennadii Madan Oct 11 '18 at 13:46
  • interesting, i'll take a look at conda. – MrGoodfix Oct 11 '18 at 13:47
  • You don't need all of them in `/usr/bin/`. I have many Pythons (from 2.7 to 3.7) in `~/.local/bin` and I have a separate Python 2.7.10 in `~/.local/Python-2.7.10/bin`. When I need a virtualenv with that specific Python I run `mkvirtualenv -p ~/.local/Python-2.7.10/bin/python2.7`. – phd Oct 11 '18 at 17:55
  • that's cool. you always have permission in your own home dir. are you downloading their tarballs and extracting them manually then? – MrGoodfix Oct 11 '18 at 19:28

0 Answers0