Is there a conflict between google-cloud-language, pandas, and conda?

84 Views Asked by At

In order to feed text strings stored in a .csv file into Google's named entity extractor, I would like to use the Google NLP API and pandas together. I am currently using conda to manage my python environments.

These are the steps I have taken:

Part 1: Install google-cloud-language in conda environment

conda create —n myenv
conda activate myenv
pip install google-cloud-language

Run example program:

python language_entities_text.py

Output:

Representative name for the entity: California
Entity type: LOCATION
Salience score: 1.0
wikipedia_url: https://en.wikipedia.org/wiki/California
mid: /m/01n7q
Mention text: California
Mention type: PROPER
Mention text: state
Mention type: COMMON
Language of the text: en

So far so good. Google's example program works

Part 2: Install pandas and run the same program

conda install pandas

or

pip install pandas

Run the same program:

python language_entities_text.py

After I install pandas using conda or pip and run the same program, I get an error.

Error message:

"Traceback (most recent call last):
  File "language_entities_text.py", line 28, in <module>
    from google.cloud import language_v1
ModuleNotFoundError: No module named 'google'

What is going on? Is there a conflict between google-cloud-language and pandas? How can I get both libraries to work together? Ideally, I would like to keep using conda because that is what I am familiar with but is conda the problem?

0

There are 0 best solutions below