AttributeError: module 'pennylane.math' has no attribute 'squeeze'

Running a code file and getting the following error:

(qnns_pennylane_venv) zchandani@lambda-quad:~/qnns_pennylane$ python qnns8.py
Traceback (most recent call last):
  File "qnns8.py", line 131, in <module>
    qnn(x_train[1], params)
  File "/home/zchandani/qnns_pennylane_venv/lib/python3.6/site-packages/pennylane/qnode.py", line 625, in __call__
    return qml.math.squeeze(res)
AttributeError: module 'pennylane.math' has no attribute 'squeeze'


Here are the package versions too:

Package          Version
---------------- -------
appdirs          1.4.4
autograd         1.3
autoray          0.2.5
cycler           0.10.0
decorator        4.4.2
future           0.18.2
joblib           1.0.1
kiwisolver       1.3.1
matplotlib       3.3.4
networkx         2.5.1
numpy            1.19.5
pandas           1.1.5
PennyLane        0.16.0
Pillow           8.3.1
pip              21.1.3
pkg-resources    0.0.0
pyparsing        2.4.7
python-dateutil  2.8.1
pytz             2021.1
scikit-learn     0.24.2
scipy            1.5.4
semantic-version 2.6.0
setuptools       39.0.1
six              1.16.0
threadpoolctl    2.1.0
toml             0.10.2

Any help is much appreciated, let me know if you’d like further information. Thanks.

Hi @Zohim_Chandani1,

One possible cause for this problem is that you are using Python 3.6. We stopped actively supporting 3.6 in PennyLane 0.16.0, so my recommendation would be to upgrade your Python version to between 3.7 to 3.9.

Let us know if that helps!
Thanks