Python programs coexisting on Windows

I am looking for a way to allow multiple Python programs to coexist on the same Windows machine.

Here's the problem: suppose that program A requires Python 2.5, B - 2.6, C - 3, and each of them needs its own version of Qt, Wx or any other modules or something else.

Attempting to install all these dependencies on one computer will break things, for example. you can install different versions of Python side by side, but only one of them can have an association of .py files, so if you pass this to Python 2.5, then B and C will not work, etc.

An ideal state of affairs would be if program A could live in C: \ A with its own Python interpreter, Qt / Wx / MySQL / driver independently and never touch anything outside this directory, the same for B and C .

Is there any way to do this other than switching to the full virtual box route?

edit: I tried the solution to the batch file, but it does not work. That is, it works on simple test cases, but, for example, OpenRPG fails at some point in the boot process if its required version of Python does not own the file association.

+3
source share
6 answers
0

VirtualEnv.

virtualenv - Python.

, , . , 1 LibFoo, 2. ? /usr/lib/python 2.4/site-packages ( ), , , .

.

, , pip, . v 1.0 python v 2.x 1.1 python v 2.x, , virtualenv , Virtualenv + pip - .

+7

, , :

c:\python26\python.exe C:\Script_B\B.py

runB.bat( - .bat). c:\python26\python.exe, .

+2

, . .

, , .

+1

EXEs? , , , EXE, python. .. .

+1

python script, unix- - , #! (-). python script exec .

.py script.

0

Source: https://habr.com/ru/post/1723611/


All Articles