0
$\begingroup$

I have just installed Qiskit, Qutip, and Cirq in my Anaconda Enviornment. When I tried to run the test program:

import cirq
from cirq import *
print(cirq.google.Foxtail)
# should print:
# (0, 0)───(0, 1)───(0, 2)───(0, 3)───(0, 4)───(0, 5)───(0, 6)───(0, 7)───(0, 8)───(0, 9)───(0, 10)
# │        │        │        │        │        │        │        │        │        │        │
# │        │        │        │        │        │        │        │        │        │        │
# (1, 0)───(1, 1)───(1, 2)───(1, 3)───(1, 4)───(1, 5)───(1, 6)───(1, 7)───(1, 8)───(1, 9)───(1, 10)

But it's giving this error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [2], in <cell line: 4>()
      1 import cirq
      2 from cirq import *
      ----> 4 print(cirq.google.Foxtail)

      AttributeError: module 'cirq' has no attribute 'google'

I am new to this field. Please Help.

$\endgroup$

1 Answer 1

1
$\begingroup$

Cirq was modularized last year. cirq.google is now moved to its own module, cirq_google, try that.

import cirq_google
print(cirq_google.Foxtail)

If that's not working make sure the cirq-google pip package is installed.

$\endgroup$
2
  • 1
    $\begingroup$ Hey I successfully Installed cirq_google, but now it's saying- AttributeError: module 'cirq_google' has no attribute 'Foxtail' $\endgroup$ Aug 6 at 14:06
  • $\begingroup$ Can you try uninstalling all the cirq modules, í.e cirq, cirq-core, etc and then reinstalling? Sometimes, when you update on top of an old (pre modularization) cirq, it can cause this issue. $\endgroup$ Aug 7 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.