You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use Video Intelligence API but getting Import Error in the following two import Statements:
from google.cloud.gapic.videointelligence.v1beta1 import enums
from google.cloud.gapic.videointelligence.v1beta1 import (video_intelligence_service_client)
Error: ImportError: No module named videointelligence.v1beta1
Can you please suggest how can this issue be resolved ?
@jonparrott@gguuss Since the VideoIntelligence API is in Private Beta currently, Can I verify somehow If I have been granted the access yet ?
[I signed up for the access 3 days ago. But haven't received any confirmation yet]
@jonparrott Okay.
Btw, The only setup I have done for this is: pip install https://storage.googleapis.com/videointelligence-alpha/videointelligence-python.zip
and just ran these two commands from the python shell:
from google.cloud.gapic.videointelligence.v1beta1 import video_intelligence_service_client
video_client = video_intelligence_service_client.VideoIntelligenceServiceClient()
The API definitely will not work until after you have been whitelisted but should not be failing when you are instantiating the client but instead when you create an operation, for example:
I'm guessing that there is something wrong with the way you have Python configured. Are you using virtual environment and are you on Python 2.x or Python 3.x?
@gguuss@jonparrott I am not using Virtual Environment & my python version is: Python 2.7.
And I am trying the above two commands in the python shell. (using python manage.py shell).
Tried these two commands from GCE VM Instance too. Got Import Error there.
[if it helps]
sudo python manage.py shell
Python 2.7.9 (default, Jun 29 2016, 13:08:31)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from google.cloud.gapic.videointelligence.v1beta1 import video_intelligence_service_client
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client.py", line 31, in <module>
from google.gapic.longrunning import operations_client
ImportError: No module named gapic.longrunning
@naveensinghal I highly recommend you install the requirements.txt in a virtualenv before trying to run the sample. Virtualenv helps isolate system packages and the sample's packages from one another, which is a common case of issues.
@gguuss@jonparrott
I am trying to implement VideoIntelligence API in my personal-project. but I am not able to do so yet. [I have the access permissions for VideoIntelligence API for my personal-project]
Please provide some suggestions to make it work.
I tried the following commands:
(venv) naveen@naveen:~/Desktop/personal-project$ python manage.py shell
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from google.cloud.gapic.videointelligence.v1beta1 import video_intelligence_service_client
>>> video_client = video_intelligence_service_client.VideoIntelligenceServiceClient()
>>> path = 'gs://demomaker/google_gmail.mp4'
>>> features = [2]
>>> operation = video_client.annotate_video(path, features)
But I am getting this as the Error:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "personal-project/venv/local/lib/python2.7/site-packages/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client.py", line 234, in annotate_video
self._annotate_video(request, options), self.operations_client,
File "personal-project/venv/local/lib/python2.7/site-packages/google/gax/api_callable.py", line 419, in inner
return api_caller(api_call, this_settings, request)
File "personal-project/venv/local/lib/python2.7/site-packages/google/gax/api_callable.py", line 407, in base_caller
return api_call(*args)
File "personal-project/venv/local/lib/python2.7/site-packages/google/gax/api_callable.py", line 368, in inner
return a_func(*args, **kwargs)
File "personal-project/venv/local/lib/python2.7/site-packages/google/gax/retry.py", line 126, in inner
' classified as transient', exception)
RetryError: GaxError(Exception occurred in retry method that was not classified as transient, caused by <_Rendezvous of RPC that terminated with (StatusCode.PERMISSION_DENIED, Google Cloud Video Intelligence API has not been used in project usable-auth-library before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/videointelligence.googleapis.com/overview?project=usable-auth-library then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.)>)
It is searching inside 'usable-auth-library' project. Whereas I have access permission for my 'personal-project'. How can I make this work ?
Hi @naveensinghal, you likely need to setup service account credentials to be able to call, as the credentials provided by gcloud can not currently be used with this API.
Activity
theacodes commentedon Mar 10, 2017
Hi @naveensinghal, just a sanity check did you run
pip install -r requirements.txtin a virtualenv?naveensinghal commentedon Mar 10, 2017
@jonparrott Are you talking about this requirements.txt ?
Path: https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/video/cloud-client/requirements.txt
I haven't done
pip install -r requirements.txtfor this file yet.theacodes commentedon Mar 10, 2017
naveensinghal commentedon Mar 10, 2017
@jonparrott @gguuss Just did that....
Getting a different Error now... [Import Error seems to be fixed though]
Any Suggestions for this ?
[-]ImportError: No module named videointelligence.v1beta1[/-][+]Google Videointelligence.v1beta1 Usage[/+]theacodes commentedon Mar 13, 2017
@gguuss any ideas?
naveensinghal commentedon Mar 13, 2017
@jonparrott @gguuss Since the VideoIntelligence API is in Private Beta currently, Can I verify somehow If I have been granted the access yet ?
[I signed up for the access 3 days ago. But haven't received any confirmation yet]
theacodes commentedon Mar 13, 2017
@naveensinghal if you haven't heard back yet you probably do not have access. Still, this error is unrelated.
naveensinghal commentedon Mar 13, 2017
@jonparrott Okay.
Btw, The only setup I have done for this is:
pip install https://storage.googleapis.com/videointelligence-alpha/videointelligence-python.zipand just ran these two commands from the python shell:
and got the above mentioned stack trace Error.
Is there anything else that needs to be done ?
gguuss commentedon Mar 13, 2017
The API definitely will not work until after you have been whitelisted but should not be failing when you are instantiating the client but instead when you create an operation, for example:
I'm guessing that there is something wrong with the way you have Python configured. Are you using virtual environment and are you on Python 2.x or Python 3.x?
naveensinghal commentedon Mar 14, 2017
@gguuss @jonparrott I am not using Virtual Environment & my python version is: Python 2.7.
And I am trying the above two commands in the python shell. (using python manage.py shell).
Tried these two commands from GCE VM Instance too. Got Import Error there.
[if it helps]
theacodes commentedon Mar 14, 2017
@naveensinghal I highly recommend you install the requirements.txt in a virtualenv before trying to run the sample. Virtualenv helps isolate system packages and the sample's packages from one another, which is a common case of issues.
gguuss commentedon Mar 14, 2017
The following worked for me from Cloud shell:
naveensinghal commentedon Mar 18, 2017
@gguuss @jonparrott
I am trying to implement VideoIntelligence API in my personal-project. but I am not able to do so yet. [I have the access permissions for VideoIntelligence API for my personal-project]
Please provide some suggestions to make it work.
I tried the following commands:
But I am getting this as the Error:
It is searching inside 'usable-auth-library' project. Whereas I have access permission for my 'personal-project'. How can I make this work ?
Any Suggestions please ?
Thanks
theacodes commentedon Mar 20, 2017
Hi @naveensinghal, you likely need to setup service account credentials to be able to call, as the credentials provided by
gcloudcan not currently be used with this API.https://cloud.google.com/vision/docs/common/auth#set_up_a_service_account
naveensinghal commentedon Mar 20, 2017
okay. Got it.
Thanks,
chore(deps): update all dependencies (#847)