1

I Tried very simple dll importing, but no module named error appear.

My configuration are IronPython 2.7.5 Install path is "C:\Program Files (x86)\IronPython 2.7"

1) my source foo.py:

class foo:
 def hello():
   print "hello"

2) Making dll module

ipy "Tools\Script\pyc.py" /main:foo.py / target:dll

--> Success, I got foo.dll

3) Check 1

ipy
>> import foo
>>

-->Importing Success

Check2

Delete source foo.py, leave only foo.dll
ipy
>> import clr
>> clr.AddReference("foo")
>> import foo

-> ImportError: No module named foo

I worked everything in "C:\Program Files (x86)\IronPython 2.7" directory.

jundiver
  • 11
  • 3
  • Could you explain what you are trying to do and why? Why are you compiling IronPython to a DLL to use it again from IronPython? – Simon Opelt Jan 22 '15 at 08:50
  • Thanks comment Simon. In my plan, some module are user customizable, some module are fixed and secret for user. so I want release some module by dll only without source. – jundiver Jan 25 '15 at 09:40
  • Just add the 'secret' modules to the search paths. http://stackoverflow.com/questions/1755572/ironpython-scriptruntime-equivalent-to-cpython-pythonpath/1756818#1756818 You gain nothing from compiling python to DLL. IronPython is fast enough. – cbuteau Mar 24 '15 at 13:44

0 Answers0