IronPython visual studio console app: no module named clr

Viewed 2924

I have problem with Iron-Python Console Application in Visual Studio 2017 Community. When I tired debug/run the program by clicking F5 or execute in Python Interactive, visual Studio calls an exist message:

Traceback (most recent call last): File "d:\userdata\myAccount\my documents\visual studio 2017\Projects\IronPythonApplication3\IronPythonApplication3\ IronPythonApplication3.py", line 6, in import clr ImportError: No module named clr

Here is the code I'm running:

import sys;
print("testMsg");
print("anotherMsg");
import clr;
clr.AddReference('System.Threading')
from System.Threading import Thread
world = "world"
print('Hello ' + world)
Thread.CurrentThread.Sleep(5000)

The first two print functions call correctly.

Intelisense also casts a popup that may be missing for this module.

I saw other topics on stack-overflow, and I tired to refresh the database and remove python environments but yet to get it working.

Someone could help me find solution for this problem?

1 Answers
Related