Mailinglist Archive: opensuse (389 mails)

< Previous Next >
[opensuse] running python virtual environment and tumbleweed
Ok, so in my journey of learning python, I setup a virtual environment. The command for doing so is this:
virtualenv -p <path to python in /usr/bin> <dir name virt env>

What this is supposed to do is setup everything that is necessary for running only that version of python that you want to use inside the directory name of the virtual environment.

So I set this up for python 3.6.5 in tumbleweed, and it was running fine. Then I worked on getting a new desktop set up to use as a workstation, and installed tumbleweed on it, and by that time the tumbleweed python had upgraded to 3.7.2.

I tried to copy all the files over from the virtual environment directory to a mirror directory on my desktop, but python 3.6.5 would not run in the new computer, even though it was supposed to be a virtual environment that preserved everything that was necessary to run 3.6.5. I even tried using pip freeze and pip install with all the requirements, but that didn't work.

So looking inside the virtual environment directory, I could see that all the python module files are actually just symlinks to the various python 3.6.5 files inside the /usr/bin directory. That's why it didn't work on the new machine - 3.6.5 was never installed when I put tumbleweed on it, because tumbleweed had already upgraded to 3.7.2.

So I changed the minor things in my python project so that they would run in 3.7.2. I didn't know what else to do.

But now I am faced with the continuous tumbleweed upgrades, and the possibility of it moving into python 3.8 before I am ready to be done with 3.7. My project is not nearly finished, and I am sure I will have to install modules that will only be compatible with 3.7.2 at some point in the future. Pip install should take care of any associated problems, I hope.

So I am wondering if anyone else has run into the problem of what to do about your python virtual environment, when all of a sudden you move to a new computer and cannot get the packages for your older version of python before? In general what do you do about keeping your python environment exactly how you want it?


--
George
Box: 42.3 | Plasma 5 | AMD Phenom IIX4 | 64 | 32GB
Laptop #1: TW | Plasma 5 | AMD FX 7TH GEN | 64 | 32GB
Laptop #2: TW | Plasma 5 | Core i5 | 64 | 8GB

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages