Search code examples
pythonpython-3.xgoogle-slides-api

How to use google-api-python-client package in PyCharm?


I am using PyCharm Community Edition 2022.1, with Python 3.10 interpreter. I am trying to use the google-api-python-client to add elements to a Google Slide.

I've tried import googleapiclient, but it does not recognize the package. When I click the context actions, it fails with message:

ERROR: Could not find a version that satisfies the requirement googleapiclient (from versions: none)
ERROR: No matching distribution found for googleapiclient
WARNING: You are using pip version 21.3.1; however, version 23.0.1 is available.
You should consider upgrading via the 'C:\Users\generic-user-name\PycharmProjects\generic-project-name\generic-user-name\Scripts\python.exe -m pip install --upgrade pip' command.

I've tried installing it through the terminal, which has path C:\Users\generic-user-name\PycharmProjects\generic-user-name. I used the command pip install google-api-python-client and pip install --upgrade google-api-python-client, both of which did not work even while reloading everything from disk.

How do I use this package properly? Is this even the correct one for editing Google Slide elements?


Solution

  • Use virutalenv and install package there https://virtualenv.pypa.io/en/latest/user_guide.html

    python3 -m venv env
    env/bin/pip3 install google-api-python-client
    env/bin/python3 C:\Users\generic-user-name\PycharmProjects\generic-user-name