ihmwg / python-ihm

Python package for handling IHM mmCIF and BinaryCIF files
MIT License
14 stars 7 forks source link

Installation doesn't copy ihm/util #136

Closed gtauriello closed 2 months ago

gtauriello commented 2 months ago

When updating python-ihm I observed that it wasn't working any more as I could not do an "import ihm".

My setup installs the latest python-ihm with

git clone https://github.com/ihmwg/python-ihm.git ihm.git
cd ihm.git
python3 setup.py build
python3 setup.py install

After that a simple "import ihm" in a python shell leads to the following error:

>>> import ihm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "..../lib/python3.9/site-packages/ihm-1.0-py3.9-linux-x86_64.egg/ihm/__init__.py", line 21, in <module>
    from . import util
ImportError: cannot import name 'util' from partially initialized module 'ihm' (most likely due to a circular import) (..../lib/python3.9/site-packages/ihm-1.0-py3.9-linux-x86_64.egg/ihm/__init__.py)

I could track the issue to the ihm/util folder which was recently added and which was not copied to ..../lib/python3.9/site-packages/ihm-1.0-py3.9-linux-x86_64.egg/ihm. If I manually copy the folder it all works...

In case this matters: I tested this in an ubuntu-based Docker setup and a CentOS setup where the library is installed in a venv.