Managing Multiple Python Versions on Windows
Question:
You have two Python versions (2.5 and 2.6) installed on Windows and want to selectively use them for different projects. How can you specify which version to run?
Answer:
Explicit Invocation
To run a specific Python version, explicitly invoke its executable. Instead of typing python in the command line, use the full executable path. For example:
C:\python.5\python.exe C:\python.6\python.exe
Environment Variable Manipulation
Windows examines environment variables to locate executables. You can manipulate the %PATH% variable to control which Python executable is prioritized.
%PATH%;C:\python.5;C:\python.6
Now, when you type python in the command line, the 2.5 executable will be used first. You can also create shortcuts on your desktop or Start menu that point to the specific Python executables.
The above is the detailed content of How Can I Manage Multiple Python Versions (e.g., 2.5 and 2.6) on Windows?. For more information, please follow other related articles on the PHP Chinese website!