# Error when Installing lightning-kokkos from source

**URL:** <https://discuss.pennylane.ai/t/error-when-installing-lightning-kokkos-from-source/5251>\
**Category:** PennyLane Lightning\
**Created:** [September 27, 2024, 11:04am UTC](https://discuss.pennylane.ai/t/error-when-installing-lightning-kokkos-from-source/5251 "2024-09-27T11:04:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Modee](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/modee/32/2852_2.png) [@Modee](https://discuss.pennylane.ai/u/Modee)\
**Post date:** [September 27, 2024, 11:04am UTC](https://discuss.pennylane.ai/t/error-when-installing-lightning-kokkos-from-source/5251/1 "2024-09-27T11:04:34Z")

</div>

After following the instructions here: [pennylane-lightning/README.rst at master · PennyLaneAI/pennylane-lightning · GitHub](https://github.com/PennyLaneAI/pennylane-lightning/blob/master/README.rst)

I get this error when trying to test my lightning-kokkos installation:

```auto
import pennylane as qml
dev = qml.device("lightning.kokkos", wires=24)

```

Error:

```auto
pennylane/devices/device_constructor.py", line 260, in device
    plugin_device_class = plugin_devices[name].load()
from pennylane_lightning.core import __version__
ModuleNotFoundError: No module named 'pennylane_lightning.core'

```

---

<div class="post-metadata">

**Author:** ![Modee](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/modee/32/2852_2.png) [@Modee](https://discuss.pennylane.ai/u/Modee)\
**Post date:** [September 27, 2024, 11:15am UTC](https://discuss.pennylane.ai/t/error-when-installing-lightning-kokkos-from-source/5251/2 "2024-09-27T11:15:29Z")

</div>

Additional info:  
qml.about() gives:

```auto
Platform info: Linux-5.14.21-150500.55.49_13.0.56-cray_shasta_c-x86_64-with-glibc2.31
Python version: 3.11.10
Numpy version: 1.26.4
Scipy version: 1.14.1
Installed devices:
- default.clifford (PennyLane-0.38.0)
- default.gaussian (PennyLane-0.38.0)
- default.mixed (PennyLane-0.38.0)
- default.qubit (PennyLane-0.38.0)
- default.qubit.autograd (PennyLane-0.38.0)
- default.qubit.jax (PennyLane-0.38.0)
- default.qubit.legacy (PennyLane-0.38.0)
- default.qubit.tf (PennyLane-0.38.0)
- default.qubit.torch (PennyLane-0.38.0)
- default.qutrit (PennyLane-0.38.0)
- default.qutrit.mixed (PennyLane-0.38.0)
- default.tensor (PennyLane-0.38.0)
- null.qubit (PennyLane-0.38.0)
- lightning.qubit (PennyLane_Lightning-0.38.0)
- lightning.kokkos (PennyLane_Lightning_Kokkos-0.38.0)

```

I could only build for OpenMP backend, when I try building for HIP it always fails. RocM version = 6.0.3

---

<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:** [September 30, 2024, 11:25pm UTC](https://discuss.pennylane.ai/t/error-when-installing-lightning-kokkos-from-source/5251/3 "2024-09-30T23:25:18Z")

</div>

Hi @Modee, welcome to the Forum!

Have you tried installing it via Spack or Docker as shown [here](https://pennylane.ai/install/#high-performance-computing-and-gpus)?

If this didn’t work, could you please copy-paste here the instructions you used to install from source?

I’m thinking it might be an issue of setting CMAKE\_ARGS. They should be:

```auto
CMAKE_ARGS="-DKokkos_ENABLE_HIP=ON" python -m pip install -e . --config-settings editable_mode=compat -vv

```

However it’s best to first try installing via Spack or Docker before trying to install from source.

---

<div class="post-metadata">

**Author:** ![Modee](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/modee/32/2852_2.png) [@Modee](https://discuss.pennylane.ai/u/Modee)\
**Post date:** [October 7, 2024, 12:13pm UTC](https://discuss.pennylane.ai/t/error-when-installing-lightning-kokkos-from-source/5251/4 "2024-10-07T12:13:28Z")

</div>

Thanks for the reply. Here is the instruction I used to install from source:

```auto
PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py

SKIP_COMPILATION=True pip install -e . --config-settings editable_mode=compat

PL_BACKEND="lightning_kokkos" python scripts/configure_pyproject_toml.py

CMAKE_ARGS="-DCMAKE_CXX_COMPILER=hipcc -DKokkos_ARCH_AMD_GFX90A=ON -DKokkos_ENABLE_HIP=ON -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON -DPL_BACKEND=lightning_kokkos" python -m pip install -e . --config-settings editable_mode=compat -vv

```

I followed the instructions shown here: [GitHub - PennyLaneAI/pennylane-lightning: The PennyLane-Lightning plugin provides a fast state-vector simulator written in C++ for use with PennyLane](https://github.com/PennyLaneAI/pennylane-lightning#lightning-kokkos-installation)

---

<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:** [October 10, 2024, 12:24am UTC](https://discuss.pennylane.ai/t/error-when-installing-lightning-kokkos-from-source/5251/5 "2024-10-10T00:24:45Z")

</div>

Hi @Modee,

Is there any info you can share about the system you’re running on? What’s your architecture?

Does the following work? (You might need to add the CMake option for your specific architecture `-DKokkos_ARCH_{...}=ON`)

```auto
git clone https://github.com/PennyLaneAI/pennylane-lightning.git
cd pennylane-lightning
PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py
SKIP_COMPILATION=True pip install -e . --config-settings editable_mode=compat
PL_BACKEND="lightning_kokkos" python scripts/configure_pyproject_toml.py
CMAKE_ARGS="-DKokkos_ENABLE_HIP=ON" python -m pip install -e . --config-settings editable_mode=compat -vv

```
