Installing Cirq

Choose your operating system:

If you want to create a development environment, see docs/development.md.


Installing on Linux

  1. Make sure you have python 3.5 or greater (or else python 2.7).

    See Installing Python 3 on Linux @ the hitchhiker’s guide to python.

  2. Consider using a virtual environment.

  3. Use pip to install cirq:

    pip install --upgrade pip
    pip install cirq
    
  4. (Optional) install system dependencies that pip can’t handle.

    sudo apt-get install python3-tk texlive-latex-base latexmk
    
    • Without python3-tk, plotting functionality won’t work.
    • Without texlive-latex-base and latexmk, pdf writing functionality will not work.
  5. Check that it works!

    python -c 'import cirq; 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)
    

Installing on Mac OS X

  1. Make sure you have python 3.5 or greater (or else python 2.7).

    See Installing Python 3 on Mac OS X @ the hitchhiker’s guide to python.

  2. Consider using a virtual environment.

  3. Use pip to install cirq:

    pip install --upgrade pip
    pip install cirq
    
  4. Check that it works!

    python -c 'import cirq; 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)
    

Installing on Windows

  1. If you are using the Windows Subsystem for Linux, use the Linux install instructions instead of these instructions.

  2. Make sure you have python 3.5 or greater (or else python 2.7.9+).

    See Installing Python 3 on Windows @ the hitchhiker’s guide to python.

  3. Use pip to install cirq:

    python -m pip install --upgrade pip
    python -m pip install cirq
    
  4. Check that it works!

    python -c "import cirq; 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)