# Pennylane-lightning installation and error/warning

**URL:** <https://discuss.pennylane.ai/t/pennylane-lightning-installation-and-error-warning/2253>\
**Category:** PennyLane Help\
**Created:** [November 1, 2022, 3:10am UTC](https://discuss.pennylane.ai/t/pennylane-lightning-installation-and-error-warning/2253 "2022-11-01T03:10:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jim](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@Jim](https://discuss.pennylane.ai/u/Jim)\
**Post date:** [November 1, 2022, 3:10am UTC](https://discuss.pennylane.ai/t/pennylane-lightning-installation-and-error-warning/2253/1 "2022-11-01T03:10:17Z")

</div>

Hello,

I tried to install and use lightning.qubit on a Linux cluster machine. I used this command to install pennylane-lightning:  
pip install pennylane-lightning

When I run the following python code:

import os  
os.environ[“OMP\_NUM\_THREADS”] = “2”  
import pennylane as qml  
dev = qml.device(“lightning.qubit”, wires=2)  
print(‘the end’)

I encountered this warning:

/path\_to\_conda/.conda/envs/penny3/lib/python3.11/site-packages/pennylane\_lightning/lightning\_qubit.py:707: UserWarning: Pre-compiled binaries for lightning.qubit are not available. Falling back to using the Python-based default.qubit implementation. To manually compile from source, follow the instructions at [https://pennylane-lightning.readthedocs.io/en/latest/installation.html](https://pennylane-lightning.readthedocs.io/en/latest/installation.html).  
warn(

I tried two qml versions (0.25.1 and 0.26.0 as detailed below); both had the same problem shown above. **How can I fix the problem to use lightning.qubit instead of falling back to default.qubit?** I assume the former can run faster than the latter on 20+ qubit circuits. Thanks!

BTW, I tried to use the following two ways described at the link given above to install pennylane\_lightning but was not successful (use the 0.26.0 PennyLane shown below).

git clone [https://github.com/PennyLaneAI/pennylane-lightning.git](https://github.com/PennyLaneAI/pennylane-lightning.git)  
cd pennylane-lightning  
pip install -r requirements.txt  
pip install -e .

cmake -S. -B build  
cmake --build build

* * *

**qml.about()**

Name: PennyLane  
Version: 0.25.1  
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.  
Home-page: :…  
Author:  
Author-email:  
License: Apache License 2.0  
Location: /path\_to\_conda/.conda/envs/penny3/lib/python3.11/site-packages  
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, retworkx, scipy, semantic-version, toml  
Required-by: PennyLane-Lightning

Platform info: Linux-4.18.0-193.28.1.el8\_2.x86\_64-x86\_64-with-glibc2.28  
Python version: 3.11.0  
Numpy version: 1.23.4  
Scipy version: 1.9.3  
Installed devices:

- lightning.qubit (PennyLane-Lightning-0.25.1)
- default.gaussian (PennyLane-0.25.1)
- default.mixed (PennyLane-0.25.1)
- default.qubit (PennyLane-0.25.1)
- default.qubit.autograd (PennyLane-0.25.1)
- default.qubit.jax (PennyLane-0.25.1)
- default.qubit.tf (PennyLane-0.25.1)
- default.qubit.torch (PennyLane-0.25.1)
- default.qutrit (PennyLane-0.25.1)

* * *

**qml.about()**  
Name: PennyLane  
Version: 0.26.0  
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.  
Home-page: …  
Author:  
Author-email:  
License: Apache License 2.0  
Location: /path\_to\_conda/.conda/envs/penny3/lib/python3.11/site-packages  
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, retworkx, scipy, semantic-version, toml  
Required-by: PennyLane-Lightning

Platform info: Linux-4.18.0-193.28.1.el8\_2.x86\_64-x86\_64-with-glibc2.28  
Python version: 3.11.0  
Numpy version: 1.23.4  
Scipy version: 1.9.3  
Installed devices:

- lightning.qubit (PennyLane-Lightning-0.26.1)
- default.gaussian (PennyLane-0.26.0)
- default.mixed (PennyLane-0.26.0)
- default.qubit (PennyLane-0.26.0)
- default.qubit.autograd (PennyLane-0.26.0)
- default.qubit.jax (PennyLane-0.26.0)
- default.qubit.tf (PennyLane-0.26.0)
- default.qubit.torch (PennyLane-0.26.0)
- default.qutrit (PennyLane-0.26.0)

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [November 1, 2022, 10:04pm UTC](https://discuss.pennylane.ai/t/pennylane-lightning-installation-and-error-warning/2253/2 "2022-11-01T22:04:17Z")

</div>

Hi @Jim,

Welcome to the Forum!

It will still be hard to simulate anything over 20 qubits even with `lightning.qubit`, but it will be better than using `default.qubit` . `Lightning.qubit` comes pre-installed with PennyLane so you can use it without needing a separate installation. I can reproduce your problem with Python 3.11 and I don’t get the warning anymore with Python 3.10. If you try the following does your problem get fixed?

Create a new conda environment with:  
`conda create --name name_of_your_environment python=3.10`  
Activate the environment:  
`conda activate name_of_your_environment`  
Install PennyLane  
`pip install pennylane`

This should be sufficient for successfully running your code.

Please let us know if this solves your issue!

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [November 1, 2022, 10:08pm UTC](https://discuss.pennylane.ai/t/pennylane-lightning-installation-and-error-warning/2253/3 "2022-11-01T22:08:09Z")

</div>

To complement my previous answer,

We do state in our [GitHub repository](https://github.com/PennyLaneAI/pennylane-lightning) that we only support Python versions 3.7-3.10 so changing your Python version should fix your problem.

 ![image](https://canada1.discourse-cdn.com/flex012/uploads/pennylane/original/2X/5/5010aa3b833d789683acea53db5be388abb5420d.png)

Please confirm with us though if this fixes the issue for you.

---

<div class="post-metadata">

**Author:** ![Jim](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@Jim](https://discuss.pennylane.ai/u/Jim)\
**Post date:** [November 2, 2022, 3:27am UTC](https://discuss.pennylane.ai/t/pennylane-lightning-installation-and-error-warning/2253/4 "2022-11-02T03:27:27Z")

</div>

Wow, indeed, this worked! So, installation is not at all as difficult as I thought yesterday. I should have asked earlier. Indeed I didnot notice the version not including 3.11 but this teaches me to pay more attentions to versions given in GitHub! Thanks a lot, Catalina!

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [November 2, 2022, 11:56pm UTC](https://discuss.pennylane.ai/t/pennylane-lightning-installation-and-error-warning/2253/5 "2022-11-02T23:56:23Z")

</div>

No problem @Jim! I’m glad you could fix your problem!

Enjoy using PennyLane!

---

<div class="post-metadata">

**Author:** ![Jim](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@Jim](https://discuss.pennylane.ai/u/Jim)\
**Post date:** [November 3, 2022, 12:12am UTC](https://discuss.pennylane.ai/t/pennylane-lightning-installation-and-error-warning/2253/6 "2022-11-03T00:12:19Z")

</div>

Thank you so much @CatalinaAlbornoz. We do enjoy it so far.
