After pip install google-cloud-documentai==0.3.0 (successful install), I get: ImportError: cannot import name 'documentai_v1beta3' from 'google.cloud' (unknown location). This happens in multiple environments, including a GCP notebook instance. The package installs fine but will not import. What is wrong?
`google-cloud-documentai` imports fail in GCP notebooks: kernel Python does not match pip
The package is fine — the environment is the problem. If you selected a GCP notebook instance pre-loaded for Apache Beam, its Jupyter kernel runs a different Python (/root/apache-beam-custom/bin/python) than the one pip installed into (/opt/conda/...). So the import fails even though pip install succeeded. Verify with import sys; print(sys.executable) in the notebook and compare it to the pip path. Fix it by pointing the kernel at the right Python, or (quick hack) append the site-packages path in the notebook: sys.path.append('/opt/conda/lib/python3.7/site-packages'). The reporter confirmed this exact mismatch was the cause.
Source: https://github.com/googleapis/python-documentai/issues/81
Source: https://github.com/googleapis/python-documentai/issues/81