I have a python library I am trying to use via IronPython (v2.7 RC1 [2.7.0.30]) invocation from C# application. The library uses NumPy and SciPy quite extensively, which
Not the best soultion, but its works for me:
import sys
sys.path.append(r'c:\Program Files (x86)\IronPython 2.7')
sys.path.append(r'c:\Program Files (x86)\IronPython 2.7\DLLs')
sys.path.append(r'c:\Program Files (x86)\IronPython 2.7\Lib')
sys.path.append(r'c:\Program Files (x86)\IronPython 2.7\Lib\site-packages')
import clr
clr.AddReference('mtrand.dll')
import numpy
import scipy
print numpy.__version__
print scipy.__version__
I hope it helps.
I found that, in my ActivePython V2.7.0.2, this works:
sys.path.append(r'C:\\Examples')
import examples
(assuming examples.py is in C:\Examples). This doesn't (without the r):
sys.path.append('C:\\Examples')
import examples
Because I get this:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named examples
Conclusion: mind the r''!