YWolfeee / lapjax

A JAX based package designed for efficient second order operators (e.g., laplacian) computation.
MIT License
69 stars 6 forks source link

Cannot get requirements to build wheel #23

Open garctaedius opened 3 days ago

garctaedius commented 3 days ago

I get the following error when trying to install lapjax using the method described in the readme:

$ pip install ./lapjax/
Processing ./lapjax
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [26 lines of output]
      Traceback (most recent call last):
        File "<string>", line 30, in <module>
      ModuleNotFoundError: No module named 'jax'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "xxx/venv/lapnet2/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/xxx/venv/lapnet2/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "xxx/venv/lapnet2/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/scratch_local/pip-build-env-kd6uzx95/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 332, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/scratch_local/pip-build-env-kd6uzx95/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 302, in _get_build_requires
          self.run_setup()
        File "/scratch_local/pip-build-env-kd6uzx95/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 503, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/scratch_local/pip-build-env-kd6uzx95/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 318, in run_setup
          exec(code, locals())
        File "<string>", line 32, in <module>
      ImportError: `jax` package is required for setup.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

I have already installed jax, and no matter how I install it (using the method from the readme or the recommended version of pip install -U "jax[cuda12]"), I get the same error. I'm using the newest version of pip (24.2) and python 3.11.6.

Here's my full pip freeze:

jax==0.4.33
jax-cuda12-pjrt==0.4.33
jax-cuda12-plugin==0.4.33
jaxlib==0.4.33
ml_dtypes==0.5.0
numpy==2.1.1
nvidia-cublas-cu12==12.6.1.4
nvidia-cuda-cupti-cu12==12.6.68
nvidia-cuda-nvcc-cu12==12.6.68
nvidia-cuda-runtime-cu12==12.6.68
nvidia-cudnn-cu12==9.4.0.58
nvidia-cufft-cu12==11.2.6.59
nvidia-cusolver-cu12==11.6.4.69
nvidia-cusparse-cu12==12.5.3.3
nvidia-nccl-cu12==2.23.4
nvidia-nvjitlink-cu12==12.6.68
opt-einsum==3.3.0
pip==24.2
scipy==1.14.1
setuptools==65.5.0

Any idea what might be the problem?

YWolfeee commented 1 day ago

Hi Garctaedius,

I run the following command:

conda create -n "lapjax_debug" python=3.11
conda activate lapjax_debug
pip install -U "jax[cuda12]"
pip install ./lapjax

This works well and passes the test. Can you try the commands above and see whether you can manage to run through it? If yes, can you provide a minimal installation process for me to reproduce the bug?

Thanks and looking forward to assist you!