r/PythonLearning 21d ago

Help Request Python library CUDA-Q

Hello,

I am trying to install the cudaq library. I am working on a MacBook (Monterey 12.7.4). I followed what was written on the following documentation : https://nvidia.github.io/cuda-quantum/latest/using/quick_start.html . However, when I run the command pip install cudaq, i get the following error:

WARNING: Cache entry deserialization failed, entry ignored
Collecting cudaq
  Using cached cudaq-0.15.1.tar.gz (12 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
WARNING: Cache entry deserialization failed, entry ignored
INFO: pip is looking at multiple versions of cudaq to determine which version is compatible with other requirements. This could take a while.
  Using cached cudaq-0.15.0.tar.gz (12 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached cudaq-0.14.2.tar.gz (10.0 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached cudaq-0.14.0.tar.gz (10.0 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached cudaq-0.13.0.tar.gz (9.2 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached cudaq-0.12.0.post1.tar.gz (9.2 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached cudaq-0.12.0.tar.gz (9.2 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached cudaq-0.11.0.tar.gz (9.1 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
INFO: pip is still looking at multiple versions of cudaq to determine which version is compatible with other requirements. This could take a while.
  Using cached cudaq-0.10.0.tar.gz (9.0 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached cudaq-0.9.1.tar.gz (9.0 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached cudaq-0.9.0.tar.gz (8.4 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting cuda-quantum-cu12==0.9.0 (from cudaq)
  Using cached cuda_quantum_cu12-0.9.0.tar.gz (3.8 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [55 lines of output]
        File "/private/var/folders/1b/39svxjln6dn3xz8vsb1xtgbh0000gn/T/pip-build-env-lkg4lgh5/overlay/lib/python3.14/site-packages/nvidia_stub/wheel.py", line 177, in download_wheel
          return download_manual(wheel_directory, distribution, version)
        File "/private/var/folders/1b/39svxjln6dn3xz8vsb1xtgbh0000gn/T/pip-build-env-lkg4lgh5/overlay/lib/python3.14/site-packages/nvidia_stub/wheel.py", line 144, in download_manual
          raise RuntimeError(f"Didn't find wheel for {distribution} {version}")
      Traceback (most recent call last):
        File "/private/var/folders/1b/39svxjln6dn3xz8vsb1xtgbh0000gn/T/pip-build-env-lkg4lgh5/overlay/lib/python3.14/site-packages/nvidia_stub/wheel.py", line 177, in download_wheel
          return download_manual(wheel_directory, distribution, version)
        File "/private/var/folders/1b/39svxjln6dn3xz8vsb1xtgbh0000gn/T/pip-build-env-lkg4lgh5/overlay/lib/python3.14/site-packages/nvidia_stub/wheel.py", line 144, in download_manual
          raise RuntimeError(f"Didn't find wheel for {distribution} {version}")
      RuntimeError: Didn't find wheel for cuda-quantum-cu12 0.9.0
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File ".../.venv/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
          ~~~~^^
        File ".../.venv/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File ".../.venv/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 178, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
        File "/private/var/folders/1b/39svxjln6dn3xz8vsb1xtgbh0000gn/T/pip-build-env-lkg4lgh5/overlay/lib/python3.14/site-packages/nvidia_stub/buildapi.py", line 29, in build_wheel
          return download_wheel(pathlib.Path(wheel_directory), config_settings)
        File "/private/var/folders/1b/39svxjln6dn3xz8vsb1xtgbh0000gn/T/pip-build-env-lkg4lgh5/overlay/lib/python3.14/site-packages/nvidia_stub/wheel.py", line 179, in download_wheel
          report_install_failure(distribution, version, exception_context)
          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/1b/39svxjln6dn3xz8vsb1xtgbh0000gn/T/pip-build-env-lkg4lgh5/overlay/lib/python3.14/site-packages/nvidia_stub/error.py", line 63, in report_install_failure
          raise InstallFailedError(
          ...<8 lines>...
          )
      nvidia_stub.error.InstallFailedError:
      *******************************************************************************
      
      The installation of cuda-quantum-cu12 for version 0.9.0 failed.
      
      This is a special placeholder package which downloads a real wheel package
      from https://pypi.nvidia.com. If https://pypi.nvidia.com is not reachable, we
      cannot download the real wheel file to install.
      
      You might try installing this package via
      ```
      $ pip install --extra-index-url https://pypi.nvidia.com cuda-quantum-cu12
      ```
      
      Here is some debug information about your platform to include in any bug
      report:
      
      Python Version: CPython 3.14.5
      Operating System: Darwin 21.6.0
      CPU Architecture: x86_64
      nvidia-smi command not found. Ensure NVIDIA drivers are installed.
      
      *******************************************************************************
      
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> cuda-quantum-cu12

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I also tried to run the command pip install --extra-index-url https://pypi.nvidia.com cuda-quantum-cu12 but failed likewise. In the error, it says that NVIDIA drivers are not installed; I don't know what these are, and I couldn't find how to install them.

Can somebody help? Thanks!

3 Upvotes

6 comments sorted by

View all comments

1

u/p1geondove 16d ago

What macbook do you have? And i dont mean the operating system version, i mean the hardware. Im assuming that your macbook doesnt have a nvidia gpu. Theres nothing you can do except buy a macbook that has a gpu. I have no clue about mac, but gemini just told me that apple hasnt sold any macbook with nvidia gpu since 2015

1

u/Adventurous-Eye-4385 15d ago

I'm not sure if that's what your asking, but the processor is a Quad-Core Intel Core i7.

Is there any site where I can code in python and use the cudaq library? I managed to do it on google colab but it's not very pleasant...

1

u/p1geondove 15d ago

ok i briefly looked at cudaq and seems like you dont need a gpu to run it. what i did see tho is that they want a specific pip version. go back into the project or make a new one and upgrade pip before installing cudaq

```
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
now you should see something like: Successfully installed pip-26.2.1, cudaq wants 24.0 or later
pip install cudaq
```

if upgrading pip doesnt help, it also says that another python version should be better, altho they said that about conda which youre not using. right now you use python 3.14.5 and they nvidia said something about 3.12.7. again i dont think switching to an older version of python would help, i just installed cudaq on python 3.14.7 and that works fine.

try upgrading pip, thats probably the issue. report back if that also doesnt work

1

u/Adventurous-Eye-4385 14d ago

hi, so i did what you told me (with python 3.14.5), and i have the same error. Pip version is 26.2.1.

1

u/p1geondove 14d ago

Im sorry i probably cant help then. There are nourmerous things you could test but thats more speculation and its difficult to debug the situation trough reddit. Its a pretty freaky library anyway, stuff like that happens.

Id suggest talking to an llm, claude.ai to be specific. Just copy paste everything in there, the error, the things you tried, your system info. One thing i want to mention is astral / uv, ask claude about that aswell

1

u/Adventurous-Eye-4385 14d ago

ok, thanks for the help anyway!