3

Hello everyone Iam currently using Ubuntu 24.04.1 LTS

I am downloading from linux terminal using "sudo apt-get install pymol" and successfully installing pymol.

> sudo apt-get install pymol
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
pymol is already the newest version (2.5.0+dfsg-1build6).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

However, when I am trying to run the software using terminal command pymol it is showing the following error.

$ pymol
Traceback (most recent call last):   
File "<frozen runpy>", line 189,> in _run_module_as_main   
File "<frozen runpy>", line 112, in> _get_module_details  
File "/usr/lib/python3/dist-packages/pymol/__init__.py", line 81, in> <module>>    
 from imp import find_module ModuleNotFoundError: No module named 'imp'
stumblebee
  • 4,379

2 Answers2

1

I had the same issue, and the following workaround fixed it for me:

sudo apt install python3-zombie-imp

Thanks to the comment of @steeldriver for this tip!

It seems that imp was removed from Python3.12 - see for example What’s New In Python 3.12: imp - there's a python3-zombie-imp package in universe that might provide a workaround?

akors
  • 11
0

Ref.

In Python 3.12 there is no module called imp. Instead of use importlib as:

from importlib import import_module

Additional info provided by the docs: https://docs.python.org/3/whatsnew/3.12.html#imp