BluePyOpt icon indicating copy to clipboard operation
BluePyOpt copied to clipboard

Importing imp fails in an environment with Python 3.12+

Open befeleme opened this issue 1 year ago • 1 comments

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.

befeleme avatar Dec 19 '23 11:12 befeleme

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.

anilbey avatar Dec 19 '23 11:12 anilbey

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 avatar Apr 06 '24 12:04 penguinpee

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

penguinpee avatar Apr 06 '24 13:04 penguinpee

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.

anilbey avatar Apr 08 '24 08:04 anilbey