Search code examples
python-3.xgoogle-cloud-platformimporterrorgoogle-cloud-language

ImportError cannot import 'langauge' from 'google.cloud' (unknown location)


I'm trying to incorporate google-cloud-language to use sentiment analysis. I followed the guide on the google documentation website, like so:

from google.cloud import language

When I run the script I receive the following error:

ImportError cannot import 'langauge' from 'google.cloud' (unknown location)

I try to run the script like so:

python3 scriptName.py

I've installed google-cloud-language like so:

pip3 install gooogle-cloud-language

pip install google-cloud-language

I've done that in a virtual environment and outside a virtual environment.

Nothing works. How do I properly set up my script to successfully import the NLP module from google cloud?


Solution

  • Happy to see that you resolved your issue. However, I would like to point some things out:

    1. In the error that you posted in the description there is a typo. It looked for a module named langauge instead of language.

    2. pip3 install gooogle-cloud-language and python3 -m pip install google-cloud-language should be equivalent but that may not always be the case. For example when they are not in the same path. Check this answer for more details.