# How to fix? 'E1101:Instance of 'QuantumCircuit' has no 'h' member' and 'E1101:Instance of 'QuantumCircuit' has no 'cx' member'

I'm using this simple code to test my Qiskit and learn how to use it but it keeps giving this problems, how do I fix it (Using VS Code and Anaconda Python 3.7)

import numpy as np
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qiskit import execute
# Create a Quantum Register with 3 qubits.Basicaly creating the number of qubits your system will use
q = QuantumRegister(3, 'q')
# Create a Quantum Circuit acting on the q register. Declaring the Circuit, this circuit shall create a GHZ state
circ = QuantumCircuit(q,)
# Add a H gate on qubit 0, putting this qubit in superposition.
circ.h(q[0])
# Add a CX (CNOT) gate on control qubit 0 and target qubit 1, putting
# the qubits in a Bell state.
circ.cx(q[0], q[1])
# Add a CX (CNOT) gate on control qubit 0 and target qubit 2, putting
# the qubits in a GHZ state.
circ.cx(q[0], q[2])
#Draws the circuit
from qiskit.tools.visualization import circuit_drawer
circuit_drawer(circ)


There are no errors in your program.

Pylint is a static code analysis tool and sometimes it gets confused and emits false positives. In this case, gate methods (h, cx and others) are added to QuantumCircuit dynamically at a later point, so Pylint cannot detect them. See qiskit.extensions.standard if you'd like to learn how this works.

The simplest “fix” for this “error” is making Pylint ignore those classes in your pylintrc (if your installation of Pylint comes pre-built into your IDE, you'll have to see if the IDE has some particular way of configuring Pylint).

[TYPECHECK]

# List of class names for which member attributes should not be checked (useful
# for classes with dynamically set attributes). This supports the use of
# qualified names.
ignored-classes=QuantumCircuit,CompositeGate


I guess you are following the code from the notebook getting_started_with_qiskit_terra. However it should be

circ = QuantumCircuit(q)


circ = QuantumCircuit(q,)