Question

Unable to locate packages on Ubuntu

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?


Submit an answer


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!

Sign In or Sign Up to Answer

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.

KFSys
Site Moderator
Site Moderator badge
April 27, 2025

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.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

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.