1

Trying to pass a python callback to a C# DLL. Getting Unresolved reference System I am using Pythonnet 2.5.2 on Python 3.7.6 for Win32.

My imports are:

import clr
from System import Action    #Fail Here - Unresolved reference System !
import wx
import wx.lib.filebrowsebutton as filebrowse
import os
import serial
import threading
import time
import configparser

I have tried No module named 'System'.

What is the problem? How can I continue?

user16217248
  • 3,119
  • 19
  • 19
  • 37
schanti schul
  • 681
  • 3
  • 14
  • 1
    Maybe more than one python installed? Problem with environment variables PYTHONPATH or PYTHONHOME? Does `import sys` `print(sys.version)` give the expected Python 3.7.6? – ToolmakerSteve Jan 07 '22 at 02:20

1 Answers1

0
clr.AddReference('System') #add this line before import system
RF1991
  • 2,037
  • 4
  • 8
  • 17