'How to use two different Python Versions in the same File or Project?
I have written some code in cntk, which needs Python Version 3.6 or older. The problem is that I want to use this code in a Project, which only allows Python 3.8 or newer. What's the best solution to combine these two programms?
EDIT: The 3.6 code does some deep learning predictions, which should be called from the 3.8 project to use them for other computations.
Solution 1:[1]
On Windows they get installed to separate folders, "C:\python26" and "C:\python31", but the executables have the same "python.exe" name.
I created another "C:\python" folder that contains "python.bat" and "python3.bat" that serve as wrappers to "python26" and "python31" respectively, and added "C:\python" to the PATH environment variable.
This allows me to type python or python3 in my .bat Python wrappers to start the one I desire.
On Linux, you can use the #! trick to specify which version you want a script to use.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | MrNLNG_VR |
