Skip to content

Clean installation from main fails with ModuleNotFoundError: No module named 'rhopart' #64

Description

@AbdAmmar

Describe the bug

A fresh installation of ChemTools from the current main branch completes successfully, but importing the package immediately fails because chemtools.wrappers.part imports rhopart, which is neither installed nor listed as a dependency.

The current requirements.txt lists qc-grid, qc-gbasis, qc-iodata, and mentions denspart in a comment, but does not include rhopart. However, chemtools/wrappers/part.py still contains:

from rhopart import ProAtomDB, ProAtomRecord
from rhopart import VarHirshfeld, DirectedAlphaDivergence, Hirshfeld, HirshfeldI

As a result, a clean installation from the repository cannot import chemtools.


To Reproduce

module load python/3.13.2

git clone https://github.com/theochem/chemtools.git
cd chemtools

python -m venv venv
source venv/bin/activate

pip install --upgrade pip setuptools wheel

pip install "scipy<1.15.0" numpy matplotlib nose pillow sympy
pip install git+https://github.com/theochem/iodata.git
pip install git+https://github.com/theochem/gbasis.git
pip install git+https://github.com/theochem/denspart.git

pip install -e .

Then run:

from chemtools import NCI

which produces:

Traceback (most recent call last):
  File "...", line 1, in <module>
    from chemtools import NCI
  File ".../chemtools/__init__.py", line 27, in <module>
    from chemtools.wrappers import *
  File ".../chemtools/wrappers/__init__.py", line 28, in <module>
    from chemtools.wrappers.part import *
  File ".../chemtools/wrappers/part.py", line 34, in <module>
    from rhopart import ProAtomDB, ProAtomRecord

ModuleNotFoundError: No module named 'rhopart'

The tested commit is:

7193bc0adc42b7ae10713fd7017143a688058944

Expected behavior

A clean installation from the repository should allow:

import chemtools

without requiring additional undocumented packages.

If rhopart is still required, it should be declared as a dependency. Otherwise, the remaining rhopart imports should be replaced or removed if the intended dependency is now denspart.


Screenshots

N/A


System Information

  • OS: Rocky Linux 8.8
  • Python version: 3.13.2
  • NumPy version: 2.2.6
  • SciPy version: 1.14.1

Additional context

While investigating, I found that:

  • requirements.txt does not list rhopart.
  • pyproject.toml obtains its dependencies from requirements.txt.
  • chemtools/wrappers/part.py imports both rhopart and denspart.
  • git blame shows that the rhopart imports have been present since commit 4547ba50 (September 2024).
  • I could not find an installable rhopart package or a corresponding repository under the Theochem GitHub organization.

This suggests that either:

  • rhopart is an undeclared dependency, or
  • the migration from rhopart to denspart is incomplete.

I'd be happy to test a proposed fix.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions