Windows Forms in Visual Studio with Python
10,955
If you're getting the following error unable to resolve 'clr'
:
It's likely that you don't have a python interpreter installed or configured for Visual Studio
Per the question The environment ironpython 2.7-32 appears to be incorrectly configured or missing
The Visual Studio Installer does not include an IronPython Package option to install
So you need to:
- Download IronPython from Github and install it
- Then, select the correct Python environment within your VS project.
Author by
user1746636
Updated on June 04, 2022Comments
-
user1746636 almost 2 years
Steps to reproduce:
- I created a new project in Visual Studio
- Selected Python > Desktop > "IronPython Windows Forms Application"
However, as soon as I open the project I encountered several errors which I don't know how to solve. The errors are unresolved import clr an similar.
-
KyleMit about 5 yearsCan you include the full text of the error message you're getting?
-
user1746636 almost 5 yearsYes. The full text error says "unresolved import clr", "unresolved import System.Drawing", "unresolved import System.Windows.Forms".
-
KyleMit almost 5 yearsDid the steps I listed below help solve your problem?
-
user1746636 almost 5 yearsHi KyleMit, sorry for haven't given you an answer sooner. Lot of work and family affairs ... I've installed the IronPython Package and also selected the 3.7 64 bit Python environment but the warnings still appear. It's very surprising this happens. I believe it might be something related to he .NET framework as they are .NET assemblies. Thank you very much for your help.