# Contextualversionconflict (numpy 1.19.2), requirement.parse (numpy\<1.27.0,\>=1.19.5), (scipy)

**URL:** <https://discuss.pennylane.ai/t/contextualversionconflict-numpy-1-19-2-requirement-parse-numpy-1-27-0-1-19-5-scipy/2967>\
**Category:** Strawberry Fields\
**Created:** [May 23, 2023, 1:06pm UTC](https://discuss.pennylane.ai/t/contextualversionconflict-numpy-1-19-2-requirement-parse-numpy-1-27-0-1-19-5-scipy/2967 "2023-05-23T13:06:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amandeep](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/amandeep/32/385_2.png) [@Amandeep](https://discuss.pennylane.ai/u/Amandeep)\
**Post date:** [May 23, 2023, 1:06pm UTC](https://discuss.pennylane.ai/t/contextualversionconflict-numpy-1-19-2-requirement-parse-numpy-1-27-0-1-19-5-scipy/2967/1 "2023-05-23T13:06:32Z")

</div>

import strawberryfields as sf  
from strawberryfields import ops

dev=qml.device(“strawberryfields.tf”, wires=4, cutoff\_dim=4)

it throws an error of contextual version conflict.

I tried “strawberryfields.fock” as device, but still did not work.

I updated numpy version also. But still it throws a same error.

---

<div class="post-metadata">

**Author:** ![isaacdevlugt](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/isaacdevlugt/32/1159_2.png) [@isaacdevlugt](https://discuss.pennylane.ai/u/isaacdevlugt)\
**Post date:** [May 23, 2023, 3:28pm UTC](https://discuss.pennylane.ai/t/contextualversionconflict-numpy-1-19-2-requirement-parse-numpy-1-27-0-1-19-5-scipy/2967/2 "2023-05-23T15:28:34Z")

</div>

Hey @Amandeep,

Sounds like you just need to update numpy to something more than 1.19.2, which you can do via `pip install numpy==1.23.5`, for example. Does that solve the issue?

---

<div class="post-metadata">

**Author:** ![Amandeep](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/amandeep/32/385_2.png) [@Amandeep](https://discuss.pennylane.ai/u/Amandeep)\
**Post date:** [May 23, 2023, 3:43pm UTC](https://discuss.pennylane.ai/t/contextualversionconflict-numpy-1-19-2-requirement-parse-numpy-1-27-0-1-19-5-scipy/2967/3 "2023-05-23T15:43:59Z")

</div>

@isaacdevlugt

Thank you for your response.  
I already did that. But still the error remains same.

---

<div class="post-metadata">

**Author:** ![isaacdevlugt](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/isaacdevlugt/32/1159_2.png) [@isaacdevlugt](https://discuss.pennylane.ai/u/isaacdevlugt)\
**Post date:** [May 23, 2023, 4:02pm UTC](https://discuss.pennylane.ai/t/contextualversionconflict-numpy-1-19-2-requirement-parse-numpy-1-27-0-1-19-5-scipy/2967/4 "2023-05-23T16:02:57Z")

</div>

Can you provide your full code that reproduces the error along with `strawberryfields.about()`?

---

<div class="post-metadata">

**Author:** ![Amandeep](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/amandeep/32/385_2.png) [@Amandeep](https://discuss.pennylane.ai/u/Amandeep)\
**Post date:** [May 23, 2023, 4:06pm UTC](https://discuss.pennylane.ai/t/contextualversionconflict-numpy-1-19-2-requirement-parse-numpy-1-27-0-1-19-5-scipy/2967/5 "2023-05-23T16:06:43Z")

</div>

after importing the libraries. I am just declaring the qml.device at the beginning.

from pennylane import numpy as np  
import pennylane as qml  
import tensorflow as tf  
import strawberryfields as sf  
from strawberryfields import ops

dev=qml.device(“strawberryfields.tf”, wires=4, cutoff\_dim=4)

---

<div class="post-metadata">

**Author:** ![isaacdevlugt](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/isaacdevlugt/32/1159_2.png) [@isaacdevlugt](https://discuss.pennylane.ai/u/isaacdevlugt)\
**Post date:** [May 23, 2023, 4:23pm UTC](https://discuss.pennylane.ai/t/contextualversionconflict-numpy-1-19-2-requirement-parse-numpy-1-27-0-1-19-5-scipy/2967/6 "2023-05-23T16:23:55Z")

</div>

Hmm, I can’t replicate your error. Here is the output of `sf.about()` and `qml.about()` for me:

```auto
Strawberry Fields: a Python library for continuous-variable quantum circuits.
Copyright 2018-2020 Xanadu Quantum Technologies Inc.

Python version: 3.9.14
Platform info: macOS-13.3.1-x86_64-i386-64bit
Installation path: /Users/isaac/pennylane-sf-plugin/lib/python3.9/site-packages/strawberryfields
Strawberry Fields version: 0.23.0
Numpy version: 1.23.5
Scipy version: 1.10.1
SymPy version: 1.12
NetworkX version: 3.1
The Walrus version: 0.20.0
Blackbird version: 0.5.0
XCC version: 0.3.0
TensorFlow version: 2.12.0

```

```auto
Name: PennyLane
Version: 0.29.1
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.
Home-page: https://github.com/XanaduAI/pennylane
Author: 
Author-email: 
License: Apache License 2.0
Location: /Users/isaac/pennylane-sf-plugin/lib/python3.9/site-packages
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, requests, retworkx, scipy, semantic-version, toml
Required-by: PennyLane-Lightning, PennyLane-SF

Platform info: macOS-13.3.1-x86_64-i386-64bit
Python version: 3.9.14
Numpy version: 1.23.5
Scipy version: 1.10.1
Installed devices:
- default.gaussian (PennyLane-0.29.1)
- default.mixed (PennyLane-0.29.1)
- default.qubit (PennyLane-0.29.1)
- default.qubit.autograd (PennyLane-0.29.1)
- default.qubit.jax (PennyLane-0.29.1)
- default.qubit.tf (PennyLane-0.29.1)
- default.qubit.torch (PennyLane-0.29.1)
- default.qutrit (PennyLane-0.29.1)
- null.qubit (PennyLane-0.29.1)
- strawberryfields.fock (PennyLane-SF-0.29.1)
- strawberryfields.gaussian (PennyLane-SF-0.29.1)
- strawberryfields.gbs (PennyLane-SF-0.29.1)
- strawberryfields.remote (PennyLane-SF-0.29.1)
- strawberryfields.tf (PennyLane-SF-0.29.1)
- lightning.qubit (PennyLane-Lightning-0.30.0)

```

---

<div class="post-metadata">

**Author:** ![isaacdevlugt](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/isaacdevlugt/32/1159_2.png) [@isaacdevlugt](https://discuss.pennylane.ai/u/isaacdevlugt)\
**Post date:** [May 23, 2023, 4:24pm UTC](https://discuss.pennylane.ai/t/contextualversionconflict-numpy-1-19-2-requirement-parse-numpy-1-27-0-1-19-5-scipy/2967/7 "2023-05-23T16:24:48Z")

</div>

Note that the PL-SF is only supported up to v0.29.1 of PennyLane 🙂

---

<div class="post-metadata">

**Author:** ![Amandeep](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/amandeep/32/385_2.png) [@Amandeep](https://discuss.pennylane.ai/u/Amandeep)\
**Post date:** [May 23, 2023, 4:28pm UTC](https://discuss.pennylane.ai/t/contextualversionconflict-numpy-1-19-2-requirement-parse-numpy-1-27-0-1-19-5-scipy/2967/8 "2023-05-23T16:28:24Z")

</div>

@isaacdevlugt  
I did that.

Strawberry Fields: a Python library for continuous-variable quantum circuits.  
Copyright 2018-2020 Xanadu Quantum Technologies Inc.

Python version: 3.8.16  
Platform info: Linux-3.10.0-1160.62.1.el7.x86\_64-x86\_64-with-glibc2.17  
Installation path: /home/bhatia87/.conda/envs/cent7/2020.11-py38/abcd/lib/python3.8/site-packages/strawberryfields  
Strawberry Fields version: 0.23.0  
Numpy version: 1.23.5  
Scipy version: 1.10.1  
SymPy version: 1.8  
NetworkX version: 2.8.4  
The Walrus version: 0.20.0  
Blackbird version: 0.5.0  
XCC version: 0.3.0

Name: PennyLane  
Version: 0.28.0  
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.  
Home-page: [GitHub - PennyLaneAI/pennylane: PennyLane is a cross-platform Python library for differentiable programming of quantum computers. Train a quantum computer the same way as a neural network.](https://github.com/XanaduAI/pennylane)  
Author:  
Author-email:  
License: Apache License 2.0  
Location: /home/bhatia87/.local/lib/python3.8/site-packages  
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, requests, retworkx, scipy, semantic-version, toml  
Required-by: PennyLane-Lightning, PennyLane-qiskit, PennyLane-SF, pennylearn

Platform info: Linux-3.10.0-1160.62.1.el7.x86\_64-x86\_64-with-glibc2.17  
Python version: 3.8.16  
Numpy version: 1.23.5  
Scipy version: 1.10.1  
Installed devices:

- default.gaussian (PennyLane-0.28.0)
- default.mixed (PennyLane-0.28.0)
- default.qubit (PennyLane-0.28.0)
- default.qubit.autograd (PennyLane-0.28.0)
- default.qubit.jax (PennyLane-0.28.0)
- default.qubit.tf (PennyLane-0.28.0)
- default.qubit.torch (PennyLane-0.28.0)
- default.qutrit (PennyLane-0.28.0)
- null.qubit (PennyLane-0.28.0)
- lightning.qubit (PennyLane-Lightning-0.29.0)
- strawberryfields.fock (PennyLane-SF-0.29.1)
- strawberryfields.gaussian (PennyLane-SF-0.29.1)
- strawberryfields.gbs (PennyLane-SF-0.29.1)
- strawberryfields.remote (PennyLane-SF-0.29.1)
- strawberryfields.tf (PennyLane-SF-0.29.1)
- qiskit.aer (PennyLane-qiskit-0.29.0)
- qiskit.basicaer (PennyLane-qiskit-0.29.0)
- qiskit.ibmq (PennyLane-qiskit-0.29.0)
- qiskit.ibmq.circuit\_runner (PennyLane-qiskit-0.29.0)
- qiskit.ibmq.sampler (PennyLane-qiskit-0.29.0)

---

<div class="post-metadata">

**Author:** ![isaacdevlugt](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/isaacdevlugt/32/1159_2.png) [@isaacdevlugt](https://discuss.pennylane.ai/u/isaacdevlugt)\
**Post date:** [May 23, 2023, 5:28pm UTC](https://discuss.pennylane.ai/t/contextualversionconflict-numpy-1-19-2-requirement-parse-numpy-1-27-0-1-19-5-scipy/2967/9 "2023-05-23T17:28:46Z")

</div>

I tried creating a virtual environment with those exact specs and I can’t replicate your version issue 🤔. Maybe a safe bet to delete this virtual environment and then `python -m pip install pennylane pennylane-sf strawberryfields`. Let me know if that works! Sometimes virtual environments get messy and need deleting.
