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

Denis Akhiyarov <[email protected]>
Newsgroups gmane.comp.python.dotnet
Message-ID <CALxxJLTLiK7nH6SevXVV0Q-jmrsV5=0p+HRrhyMMkyozM_JtGA@mail.gmail.com>
Are you able to run PythonEngine.Initialize() from c#, not ironpython?


On Thursday, April 21, 2016, Cameron Hayne <cameron.hayne-/[email protected]>
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 suggestions?
> --
> Cameron Hayne
> cameron.hayne-/[email protected] <javascript:;>
>
>
> On Apr 19, 2016, at 4:37 PM, Tony Roberts <[email protected] <javascript:;>>
> wrote:
>
> > 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 further.
> >
> > Best regards,
> > Tony
> > On Tue, Apr 19, 2016 at 9:30 PM Denis Akhiyarov <
> [email protected] <javascript:;>> wrote:
> > 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 <
> cameron.hayne-/[email protected] <javascript:;>> 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 that imports the Python.Runtime DLL and then
> calls the functions provided by that DLL.
> > In my preliminary tests, I get an error about ‘copy_reg’ not being
> found. This error seems to happen when calling PythonEngine.Initialize().
>
>
>
>
>
> _________________________________________________
> Python.NET mailing list - [email protected] <javascript:;>
> https://mail.python.org/mailman/listinfo/pythondotnet
>

_________________________________________________
Python.NET mailing list - [email protected]
https://mail.python.org/mailman/listinfo/pythondotnet
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.