BlueBrain / BluePyOpt

Blue Brain Python Optimisation Library
https://bluepyopt.readthedocs.io/en/latest/
Other
198 stars 96 forks source link

Importing imp fails in an environment with Python 3.12+ #481

Closed befeleme closed 5 months ago

befeleme commented 8 months ago

In a venv with Python 3.12 and bluepyopt installed from PyPI:

>>> from bluepyopt.ephys import simulators
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "~/tmp/blue/venv/lib64/python3.12/site-packages/bluepyopt/ephys/__init__.py", line 25, in <module>
    from . import simulators  # NOQA
    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/tmp/blue/venv/lib64/python3.12/site-packages/bluepyopt/ephys/simulators.py", line 7, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'

Module imp has been removed from Python 3.12.

anilbey commented 8 months ago

Hi, at the moment bluepyopt is not supporting Python 3.12 primarily because the NEURON simulator has not yet released the necessary wheel files for Python 3.12: https://pypi.org/project/NEURON/#files.

Thanks for creating the issue, we will certainly take this into account as we work towards updating BluePyOpt for Python 3.12 compatibility.

penguinpee commented 5 months ago

Python 3.12 was added in a1f470becfe97ee6d6354862acff97824264caf4, making version 1.14.11 officially supporting Python 3.12. Has the imp issue been addressed? IOW, can this issue be closed?

penguinpee commented 5 months ago

Answering my own question: Yes! This works now in Python 3.12 without requiring zombie-imp.

anilbey commented 5 months ago

Thanks for the update @penguinpee. Yes, this PR (https://github.com/BlueBrain/BluePyOpt/pull/492) added Python 3.12 support. The ticket can be closed.