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] RuntimeError: filesystem error due to incorrect path in PennyLane Lightning #797

Open
xaviere97 opened this issue Jul 15, 2024 · 2 comments

Comments

@xaviere97
Copy link


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.

  • Steps to Reproduce
  1. Install PennyLane and PennyLane Lightning (latest versions).
  2. Run any code that utilizes PennyLane Lightning's quantum operations.
  • 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:

  • default.clifford (PennyLane-0.37.0)
  • default.gaussian (PennyLane-0.37.0)
  • default.mixed (PennyLane-0.37.0)
  • default.qubit (PennyLane-0.37.0)
  • default.qubit.autograd (PennyLane-0.37.0)
  • default.qubit.jax (PennyLane-0.37.0)
  • default.qubit.legacy (PennyLane-0.37.0)
  • default.qubit.tf (PennyLane-0.37.0)
  • default.qubit.torch (PennyLane-0.37.0)
  • default.qutrit (PennyLane-0.37.0)
  • default.qutrit.mixed (PennyLane-0.37.0)
  • default.tensor (PennyLane-0.37.0)
  • null.qubit (PennyLane-0.37.0)
  • lightning.qubit (PennyLane_Lightning-0.37.0)

Additional information

  • The error message suggests that the path construction in PennyLane Lightning is missing a forward slash before ../../scipy.libs/.

Possible Solution

Adding the missing forward slash in the relevant PennyLane Lightning code might resolve the issue.

@maliasadi
Copy link
Member

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.

@DSGuala
Copy link
Contributor

DSGuala commented Sep 6, 2024

Hi @xaviere97 are you still having issues with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants