Google Vision API in Python (Part 2): Configuration and Setup

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ม.ค. 2025

ความคิดเห็น • 106

  • @jiejenn
    @jiejenn  4 ปีที่แล้ว +13

    Update:
    Looks like Google updated the Google Vision AI library. When you import the module, please change the module name from vision to vision_v1

    • @monikasingh29
      @monikasingh29 3 ปีที่แล้ว

      It is saying python not found

  • @pabloduquearce3938
    @pabloduquearce3938 3 ปีที่แล้ว +5

    What should I do if when I write the line "from google.cloud import vision", the answer is that "No module name Google"?

  • @neilclay5835
    @neilclay5835 ปีที่แล้ว +1

    The hardest part of programming is naming things

  • @tariogounga6979
    @tariogounga6979 5 ปีที่แล้ว +2

    was struggling all day with this... thank you

  • @rajeshbollam4920
    @rajeshbollam4920 4 ปีที่แล้ว +1

    at 7:24 when i type code . in my command prompt it shows " 'code' is not recognized as an internal or external command,
    operable program or batch file."
    Can u please help me with this @Jie Jenn and can u also pls tell me about the editor that u said vsco or something , iam new to this environment and need your help in this

    • @simonlovesjesus
      @simonlovesjesus 4 ปีที่แล้ว

      I also have the same issue sir...please help me out

    • @erenyeager601
      @erenyeager601 4 ปีที่แล้ว

      the editor is called VSCode if you install it then the code command should work

  • @officialandreivladst
    @officialandreivladst 4 ปีที่แล้ว +3

    i got an error, it says:
    no name 'types' in module 'google.cloud.vision' pylint(no-name-in-module) [3, 1]

    • @sameeranpandey3936
      @sameeranpandey3936 3 ปีที่แล้ว

      Same issue

    • @eyesoflens
      @eyesoflens 3 ปีที่แล้ว

      try image = vision.Image(content=content) instead image = vision.type.Image(content=content)

    • @CKPatel
      @CKPatel 3 ปีที่แล้ว

      I too was facing the same issue. After trying all sorts of things, I found that the solution lies in opening the Command Propmpt as administrator, navigating to the project directory and then issuing the "code ." command to launch Visual Sudio Code.

  • @RAJATSHARMA-ii1gj
    @RAJATSHARMA-ii1gj 3 ปีที่แล้ว

    At 11:11, how did you manage to run this in the venv in the terminal? "(VisionAPIDemo) ........" In my case its simply just the path without the (VisionAPIDemo)

    • @krishnasahoo6676
      @krishnasahoo6676 2 ปีที่แล้ว

      Same issue with me. Did you get a resolution for this ?

  • @houssambanbino
    @houssambanbino 4 ปีที่แล้ว +1

    How did you clear your python's shell ? 11:15

    • @jiejenn
      @jiejenn  4 ปีที่แล้ว

      In VS Code, add this property to your keybinding file to assign terminal clear action to shortcut key Ctrl + K
      {
      "key": "ctrl+k",
      "command": "workbench.action.terminal.clear"
      },

  • @Unknown54340
    @Unknown54340 3 ปีที่แล้ว

    Hello man I need your help where you make Service Key, it says service account for me when I have one. What should I do? At 3:23

  • @יונתןציפורקין
    @יונתןציפורקין 2 ปีที่แล้ว

    thank you! even thoght a few things changed since you made the video, it was still the most helpfull tutorial i found online

  • @theorager15
    @theorager15 3 ปีที่แล้ว

    Hey, @Jie Jenn Thank you for the guide. Can you explain what exactly you did at 11:06? You hit run and debug or run it as a script, I'll be glad if you tell me how you run it as a script.

    • @jiejenn
      @jiejenn  3 ปีที่แล้ว

      In VS Code, you can run Python script one line at a time. I selected the code block that I want to execute, Ctrl + Shift + B to run the code.

    • @theorager15
      @theorager15 3 ปีที่แล้ว

      @@jiejenn, You rock thank you for your rapid response.
      Is that you(Ctrl + Shift + B ) did work the same with just a Shift + Enter? Is there any difference between Run Build Task and Python: Run Selection?

    • @jiejenn
      @jiejenn  3 ปีที่แล้ว +1

      @@theorager15 same command.

  • @trentonspears5304
    @trentonspears5304 3 ปีที่แล้ว +1

    I'm tracking with you, it was just a little confusing when you kept referring to "Python Venv" as "Python V-en-v" instead of "Python Virtual Environment"..I know it's a small gripe. All-in-all, this so far has been a very informative tutorial series and it's helping me immensely with my Udacity ML capstone project. Thank you!!

  • @diegoalvarezrivas4088
    @diegoalvarezrivas4088 5 ปีที่แล้ว

    when in the command prompt you write python -m venv VisionAPIDemo in the minute 5:39 it throws me an error saying that python is not a command

    • @jiejenn
      @jiejenn  5 ปีที่แล้ว +1

      Make sure you are in the command prompt when creating a virtual environment.

    • @diegoalvarezrivas4088
      @diegoalvarezrivas4088 5 ปีที่แล้ว

      thank you.

    • @bobothehobo9114
      @bobothehobo9114 4 ปีที่แล้ว

      sudo apt-get install python3-venv try that

  • @Thomastheater
    @Thomastheater 4 ปีที่แล้ว +4

    Hi when i run the code, always says No module named 'google.cloud' . But i already installed it. What could be?

    • @HarshSingh-qq1rl
      @HarshSingh-qq1rl 3 ปีที่แล้ว

      The Library is google-cloud-vision

    • @CKPatel
      @CKPatel 3 ปีที่แล้ว

      I too was facing the same issue. After trying all sorts of things, I found that the solution lies in opening the Command Propmpt as administrator, navigating to the project directory and then issuing the "code ." command to launch Visual Sudio Code.

  • @watchameme473
    @watchameme473 3 ปีที่แล้ว +2

    Hey @Jie Jenn i got a problem in my code there is an error like this ImportError: cannot import name 'types' from 'google.cloud.vision' can you help me please

  • @anmolgupta5124
    @anmolgupta5124 4 ปีที่แล้ว +1

    file is not downloading when account is created

  • @404statuscode
    @404statuscode 4 ปีที่แล้ว +9

    Here are some problems I faced and how I solved it
    First of all make sure you pip install the packages mentioned
    pip install google-cloud
    pip install google-cloud-vision
    pip install google-api-python-client
    If the "google" module is not found, it can be solved by making the venv active. Not only in the command prompt but also at the visual studio code. Todo that see the left bottom corner of the visual studio if it was like python 3.7.4 the click that enter the path to your venv and enter now it will be changed to python 3.7.4("your virtual environment name":venv)
    Now the module problem would be solved(hope😅)
    While running the program you would run into this type of error "access denied" something like that it could be a cause of not signing into the console and giving your credit/debit card details make sure you give those.

  • @crimsonarmor.
    @crimsonarmor. 5 ปีที่แล้ว +1

    I followed this video a couple times and keep getting the same error which is: "client : The term 'client' is not recognized as the
    name of a cmdlet, function, script file,.....". I know this is a very board error, but do you have any idea what this error might be? My script is a direct copy of yours besides my json file is named differently. Thanks

    • @jiejenn
      @jiejenn  5 ปีที่แล้ว

      What is your py file name? And what editor are you using? Are you sure you are importing libraries from the correct folder?

    • @mrsneaky3393
      @mrsneaky3393 4 ปีที่แล้ว

      @@jiejenn hi I am also getting the same error Help plz!

    • @ludvig4752
      @ludvig4752 4 ปีที่แล้ว

      @@jiejenn I have the same problem. Another problem I have is that the ['GOOGLE_APPLICATION_CREDENTIALS'] text is red instead of the light pink yours has. It might be correlated with the issues of not being able to use the command "client".

    • @ludvig4752
      @ludvig4752 4 ปีที่แล้ว +1

      I fixed it. You need to copy the code into your terminal window after you've copy and pasted the directory to your pythonfile.

    • @theorager15
      @theorager15 3 ปีที่แล้ว

      @@ludvig4752 How exactly you did that?

  • @AnuragHakeem
    @AnuragHakeem 5 ปีที่แล้ว +1

    When I run my python file, it runs activate.ps1. your code ran activate.bat. the error I get on following the video says that 'keyname.json' was not found though I have followed the same structure and followed the same path name also as the video.

    • @aekanshupanchal
      @aekanshupanchal 4 ปีที่แล้ว

      you should not use vscode console
      use windows cmd to activate environment and run python pile

  • @yuriyk4937
    @yuriyk4937 4 ปีที่แล้ว

    is any one having an error code - ModuleNotFoundError: No module named 'google' - im using windows 10, and vs code. Everything works fine until 11:11 can any one help out?

    • @jiejenn
      @jiejenn  4 ปีที่แล้ว

      Have you installed the vision AI library? (pip install google-cloud-vision)

    • @yuriyk4937
      @yuriyk4937 4 ปีที่แล้ว

      @@jiejenn I have installed google-cloud library pretty sure cloud-vision is in google-cloud, no? Im not sure if i need to set a specific path to the library or maybe its looking in a different place. Since my python application is in local\ maybe that's the problem?

    • @nuwandelvita2856
      @nuwandelvita2856 4 ปีที่แล้ว

      @@yuriyk4937 Did you Found any Solution?

    • @lefteriskonstantopoulos9615
      @lefteriskonstantopoulos9615 4 ปีที่แล้ว

      I also experienced the same problem, and I followed all previous steps. Perhaps my VS is not properly setup? as it does not also recognizes google definitions...

  • @vigneshkumar7537
    @vigneshkumar7537 4 ปีที่แล้ว

    did Google vision Api is OCR hand written Text?

  • @salvuccicarlos1
    @salvuccicarlos1 4 ปีที่แล้ว

    Hello, I'm a mac user. When I run the code I get the following error
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/locale.py", line 608, in setlocale
    return _setlocale(category, locale)
    locale.Error: unsupported locale setting
    bash-3.2$
    I've search on internet but I couldn't find any answer...

  • @iamnin0
    @iamnin0 2 ปีที่แล้ว

    I'm having the error cannot import name 'types' from 'google.cloud.vision'

  • @mv9819
    @mv9819 4 ปีที่แล้ว

    is it possible to run the python code for vision api in an IDE like PyCharm ? What do we need to do to set the google cloud authentication using json file for running in an IDE?

    • @jiejenn
      @jiejenn  4 ปีที่แล้ว

      PyCharm is just another IDE, so yes, you can run the Vision AI package in PyCharm. I don't use PyCharm, so unfortunately I can't help you there.

    • @mv9819
      @mv9819 4 ปีที่แล้ว

      @@jiejenn thx. i got the answer from your video 3. your videos are wonderful!

  • @MrDacruz19
    @MrDacruz19 3 ปีที่แล้ว

    Do you all guys pay for the Google Cloud services? Is there any way to wave the fees? How much do you pay for the Vision API Service?

  • @eyesoflens
    @eyesoflens 3 ปีที่แล้ว

    instance of 'imageannotatorclient' has no 'text_detection' member......someone pls help me with this error

  • @avamsisters8059
    @avamsisters8059 4 ปีที่แล้ว

    i have anaconda and thats why i am not able to do some steps what should I do? Will I have to download python separately?

    • @jiejenn
      @jiejenn  4 ปีที่แล้ว +1

      Not sure. I don't have experience working with Anaconda.

    • @avamsisters8059
      @avamsisters8059 4 ปีที่แล้ว

      @@jiejenn ohh fine i figured that out.... thanks.... this video was pretty helpful

    • @jheinerreano5690
      @jheinerreano5690 4 ปีที่แล้ว

      Anaconda suele trabajar con sus propios entornos. Lo creas con conda create --name myenv, luego en vscode asegúrate que tienes ese entorno. Desde cmd ejecutas conda info --envs para que puedas visualizar la ruta de tu entorno base de anaconda (cópiela) y desde el explorador de windows encuentra a Anaconda Prompt y pega tu ruta, añades seguidamente \Scripts\activate base y das enter. Ve a la carpeta donde tienes tu proyecto y abre la terminal y ejecutas conda activate --stack myenv
      Myenv es el nombre que le has dado en un inicio a tu entorno en anaconda. Con esto último estará ejecutando de manera anidada el entorno base y tu nuevo entorno.
      Si deseas conocer más este enlace te puede servir
      conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environment

  • @shivankitarun9476
    @shivankitarun9476 5 ปีที่แล้ว

    Hey, how did you get that VisionApi folder ?
    Im working on a project and need to use the google vision API for the same
    So need help with the installation

    • @jiejenn
      @jiejenn  5 ปีที่แล้ว

      Which folder are you referring to?

    • @shivankitarun9476
      @shivankitarun9476 5 ปีที่แล้ว

      @@jiejenn hey understood that part but i am unable to create the virtual environment to run pip

    • @shivankitarun9476
      @shivankitarun9476 5 ปีที่แล้ว

      @@jiejenn Also can i use the anaconda prompt and do all of this work in Jupyter notebook

    • @shivankitarun9476
      @shivankitarun9476 5 ปีที่แล้ว

      @@jiejenn pip command runs into error while executing .. it says found cython generated files

  • @vebbis5961
    @vebbis5961 5 ปีที่แล้ว

    Great tutorial. Thank you!

  • @prasannakumar7035
    @prasannakumar7035 3 ปีที่แล้ว

    Thanks for the awesome video.

  • @dianacarinaponcelopez4169
    @dianacarinaponcelopez4169 3 ปีที่แล้ว

    Thanks!! This helps me a lot!

    • @jiejenn
      @jiejenn  2 ปีที่แล้ว

      Glad the video helped.

  • @diaryofsandaru
    @diaryofsandaru 5 ปีที่แล้ว

    Thannks very much for this stuff!

  • @Aaroning00
    @Aaroning00 5 ปีที่แล้ว

    Hi, can you make a video about how to set GOOGLE_APPLICATION_CREDENTIALS ? i was follow the tutorials from google and set export GOOGLE_APPLICATION_CREDENTIALS="[PATH]" (Path was change to JSON file) in venv, but i still get error 'GOOGLE_APPLICATION_CREDENTIALS' is not defined

    • @Aaroning00
      @Aaroning00 5 ปีที่แล้ว

      the only thing i can do is to add GOOGLE_APPLICATION_CREDENTIALS="[PATH]" in the code.

    • @jiejenn
      @jiejenn  5 ปีที่แล้ว

      Which operation system are you using?

    • @Aaroning00
      @Aaroning00 5 ปีที่แล้ว

      @@jiejenn MacOS

    • @jiejenn
      @jiejenn  5 ปีที่แล้ว +1

      ​@Aaron Chen I have never used IOS before, so the only thing I think will help is Google's help page. I have linked the page below.
      cloud.google.com/docs/authentication/getting-started

    • @Aaroning00
      @Aaroning00 5 ปีที่แล้ว +1

      @@jiejenn Thank you very much, i think i figure it out.

  • @ashveenraj8854
    @ashveenraj8854 4 ปีที่แล้ว

    You're awesome. Thanks for this

  • @suhail5688
    @suhail5688 4 ปีที่แล้ว

    i am gettint the error ScriptAccountToken.json was npt found even though it is located in the same folder as demo,py is located..somebody help

    • @jiejenn
      @jiejenn  4 ปีที่แล้ว

      if you print os.getcwd(), is the token file in the same folder as your working directory?

    • @suhail5688
      @suhail5688 4 ปีที่แล้ว

      @@jiejenn where to type that

  • @minbeomkim7429
    @minbeomkim7429 5 ปีที่แล้ว

    my error is no module named 'google.cloud'
    when i run from google.cloud import vision
    how can i fix it?

    • @jiejenn
      @jiejenn  5 ปีที่แล้ว +2

      There could be a chance you haven't install the library. Try to install the Vision library with this command
      pip install --upgrade google-cloud-vision

    • @minbeomkim7429
      @minbeomkim7429 5 ปีที่แล้ว +1

      @@jiejenn thank you!!

    • @ridhangpanchal7465
      @ridhangpanchal7465 3 ปีที่แล้ว

      @@jiejenn even after installing it still shows the same error
      : Import "google.cloud" could not be resolved please help me out

    • @CKPatel
      @CKPatel 3 ปีที่แล้ว

      @@jiejenn I too was facing the same issue. After trying all sorts of things, I found that the solution lies in opening the Command Propmpt as administrator, navigating to the project directory and then issuing the "code ." command to launch Visual Sudio Code.

  • @saurabhghosh7800
    @saurabhghosh7800 5 ปีที่แล้ว +1

    how to do the same thing in ubuntu?

  • @magicaltorque
    @magicaltorque 3 ปีที่แล้ว

    How to fix them?
    Import "google.cloud" could not be resolved
    Import "google.cloud.vision" could not be resolved

    • @jiejenn
      @jiejenn  3 ปีที่แล้ว

      You can access Google.py source here learndataanalysis.org/google-py-file-source-code/

    • @magicaltorque
      @magicaltorque 3 ปีที่แล้ว

      ​@@jiejenn It works. Thanks.

  • @Nnjaaaaaaa
    @Nnjaaaaaaa 4 ปีที่แล้ว

    my problem is always unresolved import 'google.cloud'

    • @jiejenn
      @jiejenn  4 ปีที่แล้ว

      Have you installed the vision AI library? (pip install google-cloud-vision)

    • @Nnjaaaaaaa
      @Nnjaaaaaaa 4 ปีที่แล้ว

      @@jiejenn yes, i solved it by doing it again and again and the solution was to pip install the google cloud in the admin powershell

  • @monikasingh29
    @monikasingh29 3 ปีที่แล้ว

    It's giving me error that Google module not found

    • @jiejenn
      @jiejenn  3 ปีที่แล้ว

      check description for the source code to Google.py file.

  • @briansullivan2664
    @briansullivan2664 2 ปีที่แล้ว

    service account key

  • @ashfaqahamed308
    @ashfaqahamed308 4 ปีที่แล้ว

    your python version

  • @canercosman
    @canercosman 4 ปีที่แล้ว

    my "settings.json" is empty, what can ı do?