Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: pip install chgnet failed #160

Closed
3 of 4 tasks
DanielYang59 opened this issue Jun 3, 2024 · 10 comments · Fixed by #161 or #201
Closed
3 of 4 tasks

[Bug]: pip install chgnet failed #160

DanielYang59 opened this issue Jun 3, 2024 · 10 comments · Fixed by #161 or #201
Labels
bug Something isn't working

Comments

@DanielYang59
Copy link
Contributor

DanielYang59 commented Jun 3, 2024

Version

v0.3.7

Which OS(es) are you using?

  • MacOS (M3 Chip, MacOS 14.5)
  • Windows
  • Linux (Ubuntu 22.04, AMD EPYC 7763 CPU)

What happened?

pip install chgnet seems to fail for the latest v0.3.7 release, which also seems to impact the pymatgen CI: https://github.com/materialsproject/pymatgen/actions/runs/9350037332/job/25732649581?pr=3822

Code snippet

pip install chgnet

Log output

Building wheels for collected packages: chgnet, nvidia-ml-py3
  Building wheel for chgnet (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for chgnet (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [60 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-11.1-arm64-cpython-311
      creating build/lib.macosx-11.1-arm64-cpython-311/chgnet
      copying chgnet/__init__.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet
      creating build/lib.macosx-11.1-arm64-cpython-311/chgnet/graph
      copying chgnet/graph/graph.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/graph
      copying chgnet/graph/converter.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/graph
      copying chgnet/graph/__init__.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/graph
      copying chgnet/graph/crystalgraph.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/graph
      creating build/lib.macosx-11.1-arm64-cpython-311/chgnet/utils
      copying chgnet/utils/__init__.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/utils
      copying chgnet/utils/vasp_utils.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/utils
      copying chgnet/utils/common_utils.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/utils
      creating build/lib.macosx-11.1-arm64-cpython-311/chgnet/model
      copying chgnet/model/basis.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/model
      copying chgnet/model/functions.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/model
      copying chgnet/model/__init__.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/model
      copying chgnet/model/encoders.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/model
      copying chgnet/model/model.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/model
      copying chgnet/model/composition_model.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/model
      copying chgnet/model/layers.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/model
      copying chgnet/model/dynamics.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/model
      creating build/lib.macosx-11.1-arm64-cpython-311/chgnet/data
      copying chgnet/data/__init__.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/data
      copying chgnet/data/dataset.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/data
      creating build/lib.macosx-11.1-arm64-cpython-311/chgnet/trainer
      copying chgnet/trainer/__init__.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/trainer
      copying chgnet/trainer/trainer.py -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/trainer
      running egg_info
      writing chgnet.egg-info/PKG-INFO
      writing dependency_links to chgnet.egg-info/dependency_links.txt
      writing requirements to chgnet.egg-info/requires.txt
      writing top-level names to chgnet.egg-info/top_level.txt
      reading manifest file 'chgnet.egg-info/SOURCES.txt'
      adding license file 'LICENSE'
      writing manifest file 'chgnet.egg-info/SOURCES.txt'
      copying chgnet/graph/cygraph.pyx -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/graph
      creating build/lib.macosx-11.1-arm64-cpython-311/chgnet/pretrained
      creating build/lib.macosx-11.1-arm64-cpython-311/chgnet/pretrained/0.2.0
      copying chgnet/pretrained/0.2.0/README.md -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/pretrained/0.2.0
      copying chgnet/pretrained/0.2.0/chgnet_0.2.0_e30f77s348m32.pth.tar -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/pretrained/0.2.0
      creating build/lib.macosx-11.1-arm64-cpython-311/chgnet/pretrained/0.3.0
      copying chgnet/pretrained/0.3.0/README.md -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/pretrained/0.3.0
      copying chgnet/pretrained/0.3.0/chgnet_0.3.0_e29f68s314m37.pth.tar -> build/lib.macosx-11.1-arm64-cpython-311/chgnet/pretrained/0.3.0
      running build_ext
      Compiling chgnet/graph/cygraph.pyx because it changed.
      [1/1] Cythonizing chgnet/graph/cygraph.pyx
      building 'chgnet.graph.cygraph' extension
      creating build/temp.macosx-11.1-arm64-cpython-311
      creating build/temp.macosx-11.1-arm64-cpython-311/chgnet
      creating build/temp.macosx-11.1-arm64-cpython-311/chgnet/graph
      clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/anaconda3/include -arch arm64 -fPIC -O2 -isystem /opt/anaconda3/include -arch arm64 -I/opt/anaconda3/include/python3.11 -c chgnet/graph/cygraph.c -o build/temp.macosx-11.1-arm64-cpython-311/chgnet/graph/cygraph.o
      chgnet/graph/cygraph.c:1238:10: fatal error: 'fast_converter_libraries/create_graph.c' file not found
      #include "fast_converter_libraries/create_graph.c"
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for chgnet
  Building wheel for nvidia-ml-py3 (setup.py) ... done
  Created wheel for nvidia-ml-py3: filename=nvidia_ml_py3-7.352.0-py3-none-any.whl size=19172 sha256=390a142b23fbf3b4250902e0cd4810b5670230854a2c459a82b8ecd5c2d2a0a2
  Stored in directory: /Users/yang/Library/Caches/pip/wheels/47/50/9e/29dc79037d74c3c1bb4a8661fb608e8674b7e4260d6a3f8f51
Successfully built nvidia-ml-py3
Failed to build chgnet
ERROR: Could not build wheels for chgnet, which is required to install pyproject.toml-based projects

Code of Conduct

  • I agree to follow this project's Code of Conduct
@janosh
Copy link
Collaborator

janosh commented Jun 3, 2024

yeah i noticed that as well. haven't had time to look into it yet. if anyone wants to debug, that'd be great! first place i would look is the last run for release.yml. seems like all the wheels were built correctly so not sure why pip install chgnet in PMG CI even needs to recompile.

@DanielYang59
Copy link
Contributor Author

DanielYang59 commented Jun 3, 2024

not sure why pip install chgnet in PMG CI even needs to recompile.

pip install chgnet on my Mac machine seems to recompile as well

I noticed the fast_converter_libraries/create_graph.c is indeed missing under chgnet.graph (and the same for 0.3.5, so this might not be the reason?) :

(venv) yang@Yang-MacBook graph % pwd
/Users/yang/developer/chgnet/dist/chgnet-0.3.7/chgnet/graph
(venv) yang@Yang-MacBook graph % ls
__init__.py     converter.py    crystalgraph.py cygraph.c       cygraph.pyx     graph.py

Can recreate this locally with:

python setup.py sdist
pip install dist/chgnet-0.3.7.tar.gz

@naji-usr
Copy link

naji-usr commented Jun 3, 2024

Same problem with pip install chgnet on MacOS (M3 Chip, MacOS 14.5).
Any help with that will be great!

@arshad880
Copy link

I use CHGNet on google colab and its been having issues since Sunday, any way out?

@janosh
Copy link
Collaborator

janosh commented Jun 4, 2024

@arshad880 please use pip install chgnet==0.3.5 until we release a fix

@arshad880
Copy link

@janosh Thank you so much, it works.

@DanielYang59
Copy link
Contributor Author

DanielYang59 commented Jun 5, 2024

seems like all the wheels were built correctly so not sure why pip install chgnet in PMG CI even needs to recompile.

Yes the wheels seem built correctly but they are not uploaded to PyPI, only the source distribution is there.

For 0.3.5, however, wheels are available, so I assume there must be something wrong with uploading the wheels to PyPI (release action for 0.3.5 for comparison)

Perhaps it's good to double check the .github/workflows/release.yml (I don't have much experience with this, so looking forward to your analysis :) )?

@janosh janosh mentioned this issue Jun 5, 2024
@janosh
Copy link
Collaborator

janosh commented Jun 5, 2024

@DanielYang59 thanks for looking into this, that pinpoints the issue to the artifact download step.

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: artifact
path: dist
merge-multiple: true
pattern: dist-*

it only finds the source distribution which is named artifact.zip but not the compiled wheels which are named

name: dist-${{ matrix.os }}-${{ matrix.python-version }}

i'll try to fix this in #161

@DanielYang59
Copy link
Contributor Author

@janosh Thanks for letting me know and the fix :)

@DanielYang59
Copy link
Contributor Author

Seems v0.3.8 is working properly now, thanks for the fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants