1

Did anyone notice the difference in loading .NET dlls between IPython/Jupyter notebook/(qt)console and normal python scripts using pythonnet?

Is this a bug/behavior caused on pythonnet or ipython side?

This works in ipython and python interactive console:

import clr
clr.AddReference(r"C:\path2dll\dotnetdll")

But in regular python scripts, the sys.path has to be appended with the path to DLL:

import clr
import sys
sys.path.append(r"C:\path2dll")
clr.AddReference("dotnetdll")

Possibly similar problem:

Permission denied on dl.open() with ipython but not with python

Community
  • 1
  • 1
denfromufa
  • 5,610
  • 13
  • 81
  • 138

1 Answers1

1

in interactive mode python interpreter appends empty string "" to sys.path. As a side effect of this the buggy AssemblyManager in pythonnet was loading assemblies from full path only in interpreter mode.

denfromufa
  • 5,610
  • 13
  • 81
  • 138