Report this

What is the reason for this report?

Unable to locate packages on Ubuntu

Posted on April 27, 2025

I need to install python packages gspread and google-api-python-client which my droplet (Ubuntu 24.04) was unable to locate. I’ve already tried apt install python3-gspread and similar variants, is there any other way to install these packages?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
0

Accepted Answer

Heya,

Yep, you’re really close — the issue is that gspread and google-api-python-client are Python packages, not system packages. So instead of using apt install, you need to use pip, which is the Python package installer.

Here’s exactly what you should do:

Step 1: Make sure pip is installed

First, check if you have pip for Python 3:

python3 -m pip --version

If that shows a version, you’re good. If not, install pip:

sudo apt update
sudo apt install python3-pip

Step 2: Install gspread and google-api-python-client

Now install the two libraries with pip:

python3 -m pip install gspread google-api-python-client

This will install them system-wide.

If this is for a project, it’s a good practice to use a virtual environment to avoid messing with system packages:

python3 -m venv myenv
source myenv/bin/activate
python3 -m pip install gspread google-api-python-client

That way your project dependencies are isolated.

Heya, @eb147ecc8fba46029a0e09a862aefa

gspread and google-api-python-client are not available through apt, they must be installed with pip.

Just run:

sudo apt install python3-pip 
pip3 install gspread google-api-python-client

If you want it cleaner, you can also install them inside a virtual environment. Let me know if you want that version too!

Regards

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.