# No attribute 'MolecularData'

**URL:** <https://discuss.pennylane.ai/t/no-attribute-moleculardata/1200>\
**Category:** PennyLane Help\
**Created:** [July 17, 2021, 11:38am UTC](https://discuss.pennylane.ai/t/no-attribute-moleculardata/1200 "2021-07-17T11:38:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kennethlee897](https://avatars.discourse-cdn.com/v4/letter/k/c37758/32.png) [@kennethlee897](https://discuss.pennylane.ai/u/kennethlee897)\
**Post date:** [July 17, 2021, 11:38am UTC](https://discuss.pennylane.ai/t/no-attribute-moleculardata/1200/1 "2021-07-17T11:38:35Z")

</div>

I am trying to follow the tutorial [https://pennylane.ai/qml/demos/tutorial\_vqe.html](https://pennylane.ai/qml/demos/tutorial_vqe.html) .

import numpy as np  
symbols = [“H”, “H”]  
coordinates = np.array([0.0, 0.0, -0.6614, 0.0, 0.0, 0.6614])

import pennylane as qml

H, qubits = qml.qchem.molecular\_hamiltonian(symbols, coordinates) print("Number of qubits = ", qubits)  
print("The Hamiltonian is ", H)

But I got this output:  
AttributeError: module ‘pennylane\_qchem.qchem.openfermion’ has no attribute ‘MolecularData’.

Thanks!

---

<div class="post-metadata">

**Author:** ![sjahangiri](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/sjahangiri/32/1443_2.png) [@sjahangiri](https://discuss.pennylane.ai/u/sjahangiri)\
**Post date:** [July 17, 2021, 7:17pm UTC](https://discuss.pennylane.ai/t/no-attribute-moleculardata/1200/2 "2021-07-17T19:17:36Z")

</div>

Hi @kennethlee897 and welcome to the forum!

This seems like an installation issue. Could you please make sure that you have installed all the requirements listed [here](https://github.com/PennyLaneAI/pennylane/blob/master/qchem/requirements.txt) by re-installing qchem with `pip install pennylane-qchem`? If the error still remains, could you please run the following two commands separately and copy the outputs here?

1. `qml.about()`

2. `pip show openfermion`

Thanks.

---

<div class="post-metadata">

**Author:** ![kennethlee897](https://avatars.discourse-cdn.com/v4/letter/k/c37758/32.png) [@kennethlee897](https://discuss.pennylane.ai/u/kennethlee897)\
**Post date:** [July 20, 2021, 1:05pm UTC](https://discuss.pennylane.ai/t/no-attribute-moleculardata/1200/3 "2021-07-20T13:05:12Z")

</div>

The error still remains. For 1. it shows:

Name: PennyLane  
Version: 0.16.0  
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.  
Home-page: [https://github.com/XanaduAI/pennylane](https://github.com/XanaduAI/pennylane)  
Author: None  
Author-email: None  
License: Apache License 2.0  
Location: /Users/kennethlee897/anaconda3/lib/python3.6/site-packages  
Requires: semantic-version, appdirs, toml, scipy, numpy, autoray, networkx, autograd  
Required-by: PennyLane-SF, PennyLane-Qchem  
Platform info: Darwin-20.4.0-x86\_64-i386-64bit  
Python version: 3.6.4  
Numpy version: 1.19.5  
Scipy version: 1.5.4  
Installed devices:

- default.gaussian (PennyLane-0.16.0)
- default.mixed (PennyLane-0.16.0)
- default.qubit (PennyLane-0.16.0)
- default.qubit.autograd (PennyLane-0.16.0)
- default.qubit.jax (PennyLane-0.16.0)
- default.qubit.tf (PennyLane-0.16.0)
- default.tensor (PennyLane-0.16.0)
- default.tensor.tf (PennyLane-0.16.0)
- strawberryfields.fock (PennyLane-SF-0.16.0)
- strawberryfields.gaussian (PennyLane-SF-0.16.0)
- strawberryfields.gbs (PennyLane-SF-0.16.0)
- strawberryfields.remote (PennyLane-SF-0.16.0)
- strawberryfields.tf (PennyLane-SF-0.16.0)

---

<div class="post-metadata">

**Author:** ![kennethlee897](https://avatars.discourse-cdn.com/v4/letter/k/c37758/32.png) [@kennethlee897](https://discuss.pennylane.ai/u/kennethlee897)\
**Post date:** [July 20, 2021, 1:05pm UTC](https://discuss.pennylane.ai/t/no-attribute-moleculardata/1200/4 "2021-07-20T13:05:55Z")

</div>

For 2., it show:

and 2.

Name: openfermion

Version: 1.0.1

Summary: The electronic structure package for quantum computers.

Home-page: [http://www.openfermion.org](http://www.openfermion.org)

Author: The OpenFermion Developers

Author-email: [help@openfermion.org](mailto:help@openfermion.org)

License: Apache 2

Location: /Users/kennethlee897/anaconda3/lib/python3.6/site-packages

Requires: h5py, deprecation, cirq, numpy, sympy, pubchempy, nbformat, scipy, requests, networkx

Required-by: PennyLane-Qchem, openfermionpyscf, openfermionpsi4

---

<div class="post-metadata">

**Author:** ![sjahangiri](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/sjahangiri/32/1443_2.png) [@sjahangiri](https://discuss.pennylane.ai/u/sjahangiri)\
**Post date:** [July 20, 2021, 1:46pm UTC](https://discuss.pennylane.ai/t/no-attribute-moleculardata/1200/5 "2021-07-20T13:46:16Z")

</div>

Hi @kennethlee897 and thanks for the info. Please note that PennyLane [requires](https://github.com/PennyLaneAI/pennylane#installation) Python version 3.7 and above while your Python version is 3.6.4. I recommend installing a higher version of python and then reinstalling both PennyLane and PennyLane-Qchem. That should fix the issue but please let me know if you face any problems. Thanks.
