Skip to content

OMPython breaks with Python 3.12 #175

@JaxRaffnix

Description

@JaxRaffnix

Description

OMPython is not compatible with python 3.12 because distutils is deprecated. See 1 for details.

OMPython imports spawn from distutils and uses the find_executable() function for the class OMCSessionHelper.

Steps to reproduce

Install OpenModelica and Python 3.12. Install OMPython with this guide 2. Execute a test script:

from OMPython import OMCSessionZMQ
omc = OMCSessionZMQ()`

Expected behavior

Change the function find_executable() with the recommended subprocess.run().

Version and OS

  • Python Version
>>> import sys
>>> sys.version
'3.12.0 (tags/v3.12.0:0fb18b0, Oct  2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)]'
  • OMPython Version
>>> pip show OMPython
Name: OMPython
Version: 3.4.0
  • OpenModelica Version
OpenModelica1.23.0-dev-64bit

OS:

>>> cmd /c ver
Microsoft Windows [Version 10.0.19045.3448]

Metadata

Metadata

Assignees

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