Re: [Python.NET] calling Python via Python.Runtime DLL from IronPython

2016-04-28 Thread Denis Akhiyarov
Actually I tried embedding cpython with pythonnet 2.1 in ironpython 2.7.5 and hit the same issue! The weird thing is that copy_reg is actually importable in regular ironpython code. According to FePy project, which developed this embedding technology, this used to work with ironpython 2, which was

Re: [Python.NET] calling Python via Python.Runtime DLL from IronPython

2016-04-22 Thread Tony Roberts
This problem could be caused by two different incompatible CPython interpreters being installed. Possibly it's a .pyc file generated from another version of Python is being imported (and failing to import). Can you check what python27.dll is being used? You should be able to see it in visual studi

Re: [Python.NET] calling Python via Python.Runtime DLL from IronPython

2016-04-22 Thread Denis Akhiyarov
Are you able to run PythonEngine.Initialize() from c#, not ironpython? On Thursday, April 21, 2016, Cameron Hayne wrote: > I tried calling Py_SetPythonHome("C:\\Python27") before calling > PythonEngine.Initialize(), but I got the same problem (re ‘copy_reg’ not > found). > Any other suggest

Re: [Python.NET] calling Python via Python.Runtime DLL from IronPython

2016-04-21 Thread Cameron Hayne
I tried calling Py_SetPythonHome("C:\\Python27") before calling PythonEngine.Initialize(), but I got the same problem (re ‘copy_reg’ not found). Any other suggestions? -- Cameron Hayne cameron.ha...@introspect.ca On Apr 19, 2016, at 4:37 PM, Tony Roberts wrote: > No need to import the c

Re: [Python.NET] calling Python via Python.Runtime DLL from IronPython

2016-04-19 Thread Tony Roberts
No need to import the c Python extension - from IronPython you would be able to reference the Python.runtime assembly without it. The problem you're having sounds like the python path isn't correct for cPython. You could try setting the PYTHONHOME environment variable and see if that gets you any f

Re: [Python.NET] calling Python via Python.Runtime DLL from IronPython

2016-04-19 Thread Denis Akhiyarov
Did you try this code? http://www.voidspace.org.uk/ironpython/cpython_extensions.shtml On Tue, Apr 19, 2016 at 2:09 PM, Cameron Hayne wrote: > Should it be possible to call Python (CPython) code from IronPython (an > IronPython script) via the Python.Runtime DLL ? > I.e. an IronPython script th