Skip to content

JPype is incompatible with Python 3.7: Fatal Python error: _Py_InitializeCore: main interpreter already initialized #331

@vstinner

Description

@vstinner

Since Python 3.7, calling Py_Initialize() twice now fails with a fatal error:

Fatal Python error: _Py_InitializeCore: main interpreter already initialized

But PyInit__jpype() calls Py_Initialize() at native/python/jpype_python.cpp:161:

https://github.com/originell/jpype/blob/490eb6511a0a0b57be2191cbbf3a90bac45e5879/native/python/jpype_python.cpp#L150-L157

It doesn't make sense to call Py_Initialize() in the initialization function of a module, since Python must be initialized to able to... import jpype :-)

The fix is just to remove the call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions