# Problem using the Forest plugin

**URL:** <https://discuss.pennylane.ai/t/problem-using-the-forest-plugin/123>\
**Category:** PennyLane Forest\
**Created:** [May 1, 2019, 10:39am UTC](https://discuss.pennylane.ai/t/problem-using-the-forest-plugin/123 "2019-05-01T10:39:37Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![barthelemymp](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/barthelemymp/32/58_2.png) [@barthelemymp](https://discuss.pennylane.ai/u/barthelemymp)\
**Post date:** [May 1, 2019, 10:39am UTC](https://discuss.pennylane.ai/t/problem-using-the-forest-plugin/123/1 "2019-05-01T10:39:37Z")

</div>

Hello,

I’m doing the serie of tutorials, to learn a bit about PennyLane.  
So far everything was working just fine, but then I tried the PyTorch tutorial, which start by using a forest devices. I installed the forest software and the plugin, however when I run :

```
import pennylane as qml
import torch
from torch.autograd import Variable
dev = qml.device('forest.qvm', device='2q', noisy=True)

```

I get the following error:

```
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-2cf089c8119a> in <module>
----> 1 dev = qml.device('forest.qvm', device='2q', noisy=True)

~\.conda\envs\penny\lib\site-packages\pennylane\ __init__.py in device(name, *args, **kwargs)
    210 
    211 # load plugin device
--> 212 return plugin_device_class(*args, **options)
    213 
    214 raise DeviceError('Device does not exist. Make sure the required plugin is installed.')

~\.conda\envs\penny\lib\site-packages\pennylane_forest\qvm.py in __init__ (self, device, shots, noisy, **kwargs)
     91 "a valid QVM quantum computer, or a NetworkX graph object.")
     92 
---> 93 super(). __init__ (num_wires, shots, **kwargs)
     94 
     95 # get the qc

~\.conda\envs\penny\lib\site-packages\pennylane_forest\device.py in __init__ (self, wires, shots, **kwargs)
    187 def __init__ (self, wires, shots, **kwargs):
    188 super(). __init__ (wires, shots)
--> 189 self.forest_url = kwargs.get('forest_url', pyquil_config.compiler_url)
    190 self.qvm_url = kwargs.get('qvm_url', pyquil_config.qvm_url)
    191 self.compiler_url = kwargs.get('compiler_url', pyquil_config.compiler_url)

AttributeError: 'PyquilConfig' object has no attribute 'compiler_url'

```

I have to admit that I have no idea how to solve it, so any help would be welcome.

All the best,

b

---

<div class="post-metadata">

**Author:** ![nathan](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/nathan/32/85_2.png) [@nathan](https://discuss.pennylane.ai/u/nathan)\
**Post date:** [May 1, 2019, 2:09pm UTC](https://discuss.pennylane.ai/t/problem-using-the-forest-plugin/123/2 "2019-05-01T14:09:59Z")

</div>

Hi barthelemymp,

There are breaking changes in the latest versions of Rigetti software, and it affects PennyLane. I’m not sure if this is the same issue (@josh knows this better – perhaps he can comment), but we are working with Rigetti to fix the plugin.

Greetings,  
Nathan

---

<div class="post-metadata">

**Author:** ![josh](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/josh/32/100_2.png) [@josh](https://discuss.pennylane.ai/u/josh)\
**Post date:** [May 2, 2019, 12:39am UTC](https://discuss.pennylane.ai/t/problem-using-the-forest-plugin/123/3 "2019-05-02T00:39:35Z")

</div>

Hi @barthelemymp, thank you for flagging this! I will take a look and see if I can reproduce the bug.

Can I ask you to run the following three commands, to determine the versions of quilc, QVM, and PyQuil you are using:

```bash
quilc --version
qvm --version
python -c "import pyquil; print(pyquil. __version__ )"

```

---

<div class="post-metadata">

**Author:** ![barthelemymp](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/barthelemymp/32/58_2.png) [@barthelemymp](https://discuss.pennylane.ai/u/barthelemymp)\
**Post date:** [May 2, 2019, 9:48pm UTC](https://discuss.pennylane.ai/t/problem-using-the-forest-plugin/123/4 "2019-05-02T21:48:46Z")

</div>

Hello Josh

Here are the results from the code you asked:

`quilc --version`  
`1.6.0 [1d29de5]`

`qvm --version`  
`1.6.0 [26b5bd8]`

`python -c "import pyquil; print(pyquil. __version__ )"`  
`2.7.0`

For this one, It was on the conda environnement I created for penny lane. Maybe there is a problem related the conda environment? Penny lane and the forest plugin are only installed on the envs…

Best regards

Barthélémy

---

<div class="post-metadata">

**Author:** ![josh](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/josh/32/100_2.png) [@josh](https://discuss.pennylane.ai/u/josh)\
**Post date:** [May 6, 2019, 6:26am UTC](https://discuss.pennylane.ai/t/problem-using-the-forest-plugin/123/5 "2019-05-06T06:26:21Z")

</div>

Hi @barthelemymp,

I was able to reproduce the error using the version of PennyLane-Forest installed via pip.

This bug is currently fixed in the latest GitHub master branch of PennyLane-Forest. I will update the pip version so this bug is fixed for users that `pip install pennylane-forest` ASAP, thank you for letting us know!

In the meantime, you can switch to the GitHub development version as follows:

```bash
git clone https://github.com/rigetti/pennylane-forest
cd pennylane-forest && pip install -e .

```

After running those above two commands, the tutorial linked above should work without error.

---

<div class="post-metadata">

**Author:** ![SreeramV181](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@SreeramV181](https://discuss.pennylane.ai/u/SreeramV181)\
**Post date:** [May 22, 2019, 6:09pm UTC](https://discuss.pennylane.ai/t/problem-using-the-forest-plugin/123/6 "2019-05-22T18:09:18Z")

</div>

Hey Josh.

I have the same error. I tried doing what you did but it still isn’t working for me.

---

<div class="post-metadata">

**Author:** ![josh](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/josh/32/100_2.png) [@josh](https://discuss.pennylane.ai/u/josh)\
**Post date:** [May 22, 2019, 7:05pm UTC](https://discuss.pennylane.ai/t/problem-using-the-forest-plugin/123/7 "2019-05-22T19:05:54Z")

</div>

Hi @SreeramV181,

Can I ask you to run the following three commands, to determine the versions of quilc, QVM, and PyQuil you are using:

````auto
quilc --version
qvm --version
python -c "import pyquil; print(pyquil. __version__ )"
```Could you post the error message you are getting
````

---

<div class="post-metadata">

**Author:** ![barthelemymp](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/barthelemymp/32/58_2.png) [@barthelemymp](https://discuss.pennylane.ai/u/barthelemymp)\
**Post date:** [June 12, 2019, 3:08pm UTC](https://discuss.pennylane.ai/t/problem-using-the-forest-plugin/123/8 "2019-06-12T15:08:10Z")

</div>

little remark, what worked for was `python setup.py` and not `pip install` !

---

<div class="post-metadata">

**Author:** ![\_risto](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/_risto/32/237_2.png) [@\_risto](https://discuss.pennylane.ai/u/_risto)\
**Post date:** [June 29, 2021, 5:58pm UTC](https://discuss.pennylane.ai/t/problem-using-the-forest-plugin/123/9 "2021-06-29T17:58:22Z")

</div>

Hi @barthelemymp

Where did you write this?  
I am getting errors while trying to run  
pip install pennylane-forest & pip install pyquil  
thus I can’t run the tutorials because I get DeviceError: Device does not exist. Make sure the required plugin is installed.

---

<div class="post-metadata">

**Author:** ![theodor](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/theodor/32/178_2.png) [@theodor](https://discuss.pennylane.ai/u/theodor)\
**Post date:** [June 29, 2021, 7:36pm UTC](https://discuss.pennylane.ai/t/problem-using-the-forest-plugin/123/10 "2021-06-29T19:36:18Z")

</div>

Hi @_risto. What errors are you getting when attempting to install `pennylane-forest` and `pyquil`? If you could perhaps start a new thread on the forum and post the outputs there, I could attempt to help you figure out what’s going wrong. 🙂

---

<div class="post-metadata">

**Author:** ![\_risto](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/_risto/32/237_2.png) [@\_risto](https://discuss.pennylane.ai/u/_risto)\
**Post date:** [June 29, 2021, 7:48pm UTC](https://discuss.pennylane.ai/t/problem-using-the-forest-plugin/123/11 "2021-06-29T19:48:31Z")

</div>

Hi @theodor

Both times I get:  
 ![image](https://canada1.discourse-cdn.com/flex012/uploads/pennylane/original/1X/bcb231965d6f54b6accad53909a0ef312f34503e.png)

 ![image](https://canada1.discourse-cdn.com/flex012/uploads/pennylane/original/1X/129a27b23911d3e3c0be5cc3b8bd85543448f73b.png)

---

<div class="post-metadata">

**Author:** ![antalszava](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/antalszava/32/171_2.png) [@antalszava](https://discuss.pennylane.ai/u/antalszava)\
**Post date:** [June 29, 2021, 9:01pm UTC](https://discuss.pennylane.ai/t/problem-using-the-forest-plugin/123/12 "2021-06-29T21:01:22Z")

</div>

Hi @_risto,

It seems that the issue you’re facing will be related to the `immutables` package as the wheels cannot be built for that one in particular.

This seems to be a problem related to installing PyQuil in specific, rather than PennyLane or the PennyLane-Forest plugin. Perhaps there’s a lead in the complete traceback, on what might be going wrong. Locally I have `immutables==0.6` and `pyquil==2.21.0` installed, perhaps it is worth an attempt to try installing those versions in specific.

---

<div class="post-metadata">

**Author:** ![antalszava](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/antalszava/32/171_2.png) [@antalszava](https://discuss.pennylane.ai/u/antalszava)\
**Post date:** [June 29, 2021, 11:10pm UTC](https://discuss.pennylane.ai/t/problem-using-the-forest-plugin/123/13 "2021-06-29T23:10:11Z")

</div>

Perhaps checking your `gcc` version (C++ compiler) could also help, it might be required by `immutables`.
