Open ystade opened 1 month ago
Thanks for reporting this @ystade! This looks like it is because one of the tests depends on the braket plugin being installed (pip install amazon-braket-pennylane-plugin
).
Ideally though we should ensure that this test is skipped if braket is not installed.
This is true, we normally skip pytests if an optional package is not installed. In this case it looks to be a C++ that was added not too long ago 🤔
@ystade Normally all test and build dependencies are covered by pip install -r requirements.txt
, did you run this line before building?
The problem here seems to be very macOS specific. Everything succeeds on a fresh install of Catalyst on Ubuntu.
It seems to be that these C++ tests which call Python via an embedded interpreter for some reason do not use the site-packages from the virtual environment that was used to build catalyst.
All the required dependencies (from the requirements.txt
) are installed in that virtual environment. But they are not installed in the system python site-packages
.
This is supported by the fact that manually installing amazon-braked-sdk
and numpy==2.0
in the global site packages fixes the errors in the tests, i.e., running, e.g.,
python3.12 -m pip install --user --break-system-packages amazon-braket-sdk "numpy==2.0"
where python3.12
links to the exact version that was used to create the virtual environment (in which all dependencies, including catalyst, have been installed into as part of make all
).
Naturally, that is not a recommended fix and the C++ tests should pick up the right Python site-package
directory.
Note again, that Linux builds work out of the box and pick the packages from the virtual environment when running these tests.
Ah, thanks for surfacing the actual issue @burgholzer! We'll look into it.
Issue description
Expected behavior
When following the installation guide on https://docs.pennylane.ai/projects/catalyst/en/stable/dev/installation.html#minimal-building-from-source-guide for MacOS, after the step
make test
all tests should pass.Actual behavior
make test
the last lines of the output are the following:/Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/runtime/tests/Test_OpenQasmDevice.cpp:529: FAILED: due to unexpected exception with message: ModuleNotFoundError: No module named 'braket'
At: