Visual Studio – "The environment IronPython|2.7-32 appears to be incorrectly configured or missing"
Question:
Steps to the Reproduce:
- Open Visual Studio 2017 (Pro on Windows 10 64-bit)
- File > New Project > IronPython Application
- Run the default program:
print('Hello world')
When I run it, I get the following error:
The environment “IronPython|2.7-32” appears to be incorrectly configured or missing.
You may need to install it or create a virtual environment
I went to VS Installer, Individual Components tab, Compilers section, and checked on the Python 2.7 & 3.6 selections, but I’m still getting the problem
Answers:
You need to set up the IronPython 2.7 environment*.
*Currently you cannot do it through the Visual Studio Installer (there isn’t an IronPython Package option to install).
- You need to download IronPython and install it separately from Github.
- After it’s installed, you need to select the correct python environment within your VS project.
- If the IronPython 2.7 environment is not properly set then you have to do it manually
Hopefully, Microsoft will patch this in the future.
Download the msi file for IronPython from Github. Then copy the path where it is downloaded and add it to the path in the system environment variable. Then restart visual studio. Select the project and set the python environment to IronPython.
When switching from Python 3.8 to 3.9 I came across the same error (also with pylint). I simply edited the project.pyproj (xml) file from: <InterpreterId>Global|PythonCore|3.8</InterpreterId>
to: <InterpreterId>Global|PythonCore|3.9</InterpreterId>
.
This is Jan 2023, I am using Visual Studio Community 2022, I only needed to follow this,
then set the version of Python I am using as a default environment.
Did not need IronPython.
Steps to the Reproduce:
- Open Visual Studio 2017 (Pro on Windows 10 64-bit)
- File > New Project > IronPython Application
- Run the default program:
print('Hello world')
When I run it, I get the following error:
The environment “IronPython|2.7-32” appears to be incorrectly configured or missing.
You may need to install it or create a virtual environment
I went to VS Installer, Individual Components tab, Compilers section, and checked on the Python 2.7 & 3.6 selections, but I’m still getting the problem
You need to set up the IronPython 2.7 environment*.
*Currently you cannot do it through the Visual Studio Installer (there isn’t an IronPython Package option to install).
- You need to download IronPython and install it separately from Github.
- After it’s installed, you need to select the correct python environment within your VS project.
- If the IronPython 2.7 environment is not properly set then you have to do it manually
Hopefully, Microsoft will patch this in the future.
Download the msi file for IronPython from Github. Then copy the path where it is downloaded and add it to the path in the system environment variable. Then restart visual studio. Select the project and set the python environment to IronPython.
When switching from Python 3.8 to 3.9 I came across the same error (also with pylint). I simply edited the project.pyproj (xml) file from: <InterpreterId>Global|PythonCore|3.8</InterpreterId>
to: <InterpreterId>Global|PythonCore|3.9</InterpreterId>
.
This is Jan 2023, I am using Visual Studio Community 2022, I only needed to follow this,
then set the version of Python I am using as a default environment.
Did not need IronPython.