Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Adding Dialogflow es library to python virtualenv

First, thank you to those that contribute to this forum.

I am having a hard time trying to get the library imported into my python environment. I've tried all different methods and nothing seems to work.

I've upgraded my environment. My python version is 3.11. I have isolated the environment in its own virtualenv. I've tried uninstalling/reinstalling. I attempted the different imports.

I would greatly appreciate any direction, links, articles, kind words. Thank you.

import dialogflow_v2 as dialogflow
# import google_cloud_dialogflow as dialogflow
Solved Solved
0 2 329
1 ACCEPTED SOLUTION

Thank you for your reply. I had a few things off. I needed to install the SDK and write the following into my code:  I was using the first two (commented out with #) and they didn't work perhaps because they were deprecated. Once I did this, I was able to connect to the agent.

# import dialogflow_v2 as dialogflow
# import google_cloud_dialogflow as dialogflow
from google.cloud import dialogflow_v2beta1 as dialogflow

View solution in original post

2 REPLIES 2

Are you done installing the actual dialogflow package? You may refer to this https://pypi.org/project/dialogflow/ 

Thank you for your reply. I had a few things off. I needed to install the SDK and write the following into my code:  I was using the first two (commented out with #) and they didn't work perhaps because they were deprecated. Once I did this, I was able to connect to the agent.

# import dialogflow_v2 as dialogflow
# import google_cloud_dialogflow as dialogflow
from google.cloud import dialogflow_v2beta1 as dialogflow