Windows: How to associate different Python files with different Python environments

If you wish to have different Python files automatically run within different Python environments (i.e. associate these different Python files with different python executables), you will encounter the Windows limitation described in this article:

Windows File “open with” cannot use two applications with the same executable name

A workaround described in the same article is to create a differently-named hardlink for each python executable which you wish to associate with a Python file. The naming of these hardlinks is arbitrary, but for clarity and explicitness you could name the hardlinks of python.exe and pythonw.exe (in environment XXX), as python-XXX.exe and pythonw-XXX.exe, respectively.

Please do not enter support requests in article comments

Please use article comments for suggestions to improve the article. For individual support requests, please follow these guidelines.

Have more questions? Submit a request

Comments

Powered by Zendesk