I came across this snippet at Hello Qubit | Cirq | Google Quantum AI
try:
import cirq
except ImportError:
print("installing cirq...")
!pip install --quiet cirq
import cirq
print("installed cirq.")
Since when has installing a package via pip in code so easy ? !pip install --quiet package-name
The answers here show all sorts of ways to run an exec but no mention of !pip
Or can this be done only via a notebook ?