Open xaviere97 opened 1 month ago
Thanks @xaviere97 for reporting this issue! This is actually an interesting one. Currently, Lightning doesn't support system-level Python binaries on Debian/Ubuntu distros where packages are installed in dist-packages
instead of site-packages
. We can provide a fix if requested. In the meantime, I suggest using venv to create a Python virtual environment and re-install pennylane-lightning
in the default pip site-packages. You may also need to upgrade scipy
on your machine to use the latest features of PennyLane.
Issue description
PennyLane Lightning encounters a "filesystem error" when trying to access the
scipy.libs
directory due to an incorrect path construction. The error message indicates that a forward slash is missing before the../../
sequence in the path.Expected behavior: PennyLane Lightning should be able to locate and access the necessary SciPy files without errors.
Actual behavior: The following error occurs: RuntimeError: filesystem error: directory iterator cannot open directory: No such file or directory [/usr/local/lib/python3.10/dist-packages/pennylane_lightning/lightning_qubit_ops.cpython-310-x86_64-linux-gnu.so../../scipy.libs/]
Reproduces how often: 100%
System information:
Name: PennyLane Version: 0.37.0 Summary: PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network. Home-page: https://github.com/PennyLaneAI/pennylane Author: Author-email: License: Apache License 2.0 Location: /usr/local/lib/python3.10/dist-packages Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, packaging, pennylane-lightning, requests, rustworkx, scipy, semantic-version, toml, typing-extensions Required-by: PennyLane_Lightning
Platform info: Linux-6.1.85+-x86_64-with-glibc2.35 Python version: 3.10.12 Numpy version: 1.25.2 Scipy version: 1.11.4 Installed devices:
Additional information
../../scipy.libs/
.Possible Solution
Adding the missing forward slash in the relevant PennyLane Lightning code might resolve the issue.