Reputation: 389
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?
Upvotes: 0
Views: 1004
Reputation: 2094
Happy to see that you resolved your issue. However, I would like to point some things out:
In the error that you posted in the description there is a typo. It looked for a module named langauge
instead of language
.
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.
Upvotes: 1
Reputation: 389
As I was writing this question and going through other similar questions on stackoverflow, I found another command to try and it seems to have worked.
python3 -m pip install google-cloud-language
I did this inside my virtualenv. It could also work outside of one, but because I got it working, I did not test the outside virtualenv case.
Upvotes: 1