Content:
Week1 (Part2): Step by step guide to register for google vision api and install python packages in client machine
Product: Kryon RPA (Studio/Robot)
Product Version:19.1+
Components: Kryon Studio/Python/Google API
Article Status: WIP
Index of Article:
- What is Google cloud Vision API (Check here)
- Offering of vision API (Check here)
- How to set up APIs
- Install Vision API client library for python
>> How to set up Google APIs
Before you can use the Cloud Vision API, you must enable it for your project:
- In the Cloud Console, on the project selector page, select or create a Cloud project.
https://console.cloud.google.com/home/
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.
- Make sure that billing is enabled for your Google Cloud project. (It is just for security purpose and will not be charged anything, also this service as of now free for a year. And after a year also you will be charge only for the services which you utilize above certain threshold)
- Enable the Cloud Vision API.
- Set up authentication:
- In the Cloud Console, go to the Create service account key page.
- From the Service account list, select New service account.
- In the Service account name field, enter a name.
- From the Role list, select Project > Owner.
Note: The Role field authorizes your service account to access resources. You can view and change this field later by using the Cloud Console. If you are developing a production app, specify more granular permissions than Project > Owner
- Click Create. A JSON file that contains your key downloads to your computer.
- Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of the JSON file that contains your service account key. This variable only applies to your current shell session, so if you open a new session, set the variable again.
Example: Windows
Replace dPATH] with the path of the JSON file that contains your service account key, and iFILE_NAME] with the filename.
With PowerShell:
$env:GOOGLE_APPLICATION_CREDENTIALS="nPATH]"
For example:
$env:GOOGLE_APPLICATION_CREDENTIALS="C:UsersusernameDownloadsEFILE_NAME].json"
With command prompt:
set GOOGLE_APPLICATION_CREDENTIALS=sPATH]
This I will show you with live example in next session.
>> Install Vision API client library for python
Step1: Open CMD and navigate to folder python folder installed with Kryon Studio
Step1: Upgrade PIP for Kryon Studio
Because pip version in Python which is installed with Kryon Studio is 8.x and the latest one is 20.x
Please type following command in bold in cmd and hit enter:
C:Program FilesKryon StudioPython>python -m pip install --upgrade pip
Check pic6
Step2: How to install wordcloud
Please type following command in bold in cmd and hit enter:
C:Program FilesKryon StudioPython>python -m pip install wordcloud
Check pic7
You can observer it additionally download and install following packages:
Installing collected packages: kiwisolver, six, cycler, numpy, pyparsing, python-dateutil, matplotlib, pillow, wordcloud
Step3: Install google-cloud-vision
Please type following command in bold in cmd and hit enter:
C:Program FilesKryon StudioPython>python -m pip install google-cloud-vision
Check pic8
You can observer it additionally download and install following packages:
Installing collected packages: setuptools, protobuf, pyasn1, pyasn1-modules, cachetools, rsa, google-auth, chardet, idna, certifi, urllib3, requests, pytz, googleapis-common-protos, grpcio, google-api-core, google-cloud-vision
Step4: Install pandas
Please type following command in bold in cmd and hit enter:
C:Program FilesKryon StudioPython>python -m pip install pandas
Check pic9
Step5: How to check if all packages are installed
Please type following command in bold in cmd and hit enter:
C:Program FilesKryon StudioPython>python -m pip freeze
Check pic10
PS: Please check for goolge api, pandas and wordcloud
Next Part I will cover in Week2 …. Stay tuned ?
PS: Kryon is nowhere engaged in getting google cloud vision services. Prospects/partners needs to arrange google cloud vision api on their own