google-deepmind / google-deepmind/alphageometry

## Summary of Installation Issues with AlphaGeometry and Meliad

Open
#173 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4.9k
Forks
572
PR merge metrics
No merged PRs in 30d

Description

I am trying to run the full `alphageometry` solver by following the instructions in the `README.md`. While the `ddar` solver works perfectly after some modifications, I am unable to get the full `alphageometry` mode (which requires the Meliad library) to run.

I have followed all installation steps, including manually cloning the Meliad repository and setting the `PYTHONPATH`. However, this leads to a series of persistent import errors.

### Environment
* **Python Version**: 3.10.9 (in a virtual environment)
* **System**: Remote server (Beagle3)

### Sequence of Errors and Fixes Attempted

1. **Initial Error**: `ImportError: cannot import name 'decoder_stack' from 'transformer'`.
* This occurred because Python could not find the Meliad library.
* **Fix**: I confirmed that I had cloned Meliad into `meliad_lib/meliad` and correctly set the `PYTHONPATH` using `export PYTHONPATH=$PYTHONPATH:$(pwd)/meliad_lib/meliad`.

2. **Circular Import Error**: After fixing the path, a new error appeared: `ImportError: cannot import name 'decoder_stack' from partially initialized module 'transformer' (most likely due to a circular import)`.
* This seemed to be caused by a file name conflict, as both AlphaGeometry and Meliad have a file named `decoder_stack.py`.
* **Fix**: I renamed the AlphaGeometry file to `ag_decoder_stack.py` and updated the corresponding import statement in `models.py`.

3. **Module Not Found Error**: The previous fix led to `ModuleNotFoundError: No module named 'transformer.decoder_stack'`.
* To diagnose this, I ran a direct import test in a Python shell (`import transformer.decoder_stack`), which also failed. This confirmed the issue was with the Meliad library itself, not the AlphaGeometry script.
* **Fix**: I installed Meliad's own dependencies by running `pip install -r meliad_lib/meliad/requirements.txt`.

4. **NumPy Version Conflict**: After installing Meliad's dependencies, a new error occurred: `ImportError: numpy.core.multiarray failed to import`.
* This was because Meliad's requirements installed NumPy 2.x, which conflicted with `matplotlib` and other packages that required NumPy 1.x.
* **Fix**: I downgraded NumPy by running `pip install --force-reinstall "numpy<2.0"`.

5. **Persistent `ModuleNotFoundError`**: After all these fixes, the error has reverted back to `ModuleNotFoundError: No module named 'transformer.decoder_stack'`.

### Current Status
The purely symbolic **DDAR solver works correctly**. However, the full `alphageometry` mode is unusable due to what appears to be a fundamental issue with the way the Meliad library's modules are structured or imported. Despite all troubleshooting, the core problem of importing `transformer.decoder_stack` persists.

Any help or guidance on how to resolve this final import issue would be greatly appreciated.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.