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.
Heya,
Yep, you’re really close — the issue is that
gspread
andgoogle-api-python-client
are Python packages, not system packages. So instead of usingapt install
, you need to usepip
, which is the Python package installer.Here’s exactly what you should do:
Step 1: Make sure
pip
is installedFirst, check if you have
pip
for Python 3:If that shows a version, you’re good. If not, install pip:
Step 2: Install
gspread
andgoogle-api-python-client
Now install the two libraries with pip:
This will install them system-wide.
Step 3 (optional but recommended): Use a virtual environment
If this is for a project, it’s a good practice to use a virtual environment to avoid messing with system packages:
That way your project dependencies are isolated.
Heya, @eb147ecc8fba46029a0e09a862aefa
gspread
andgoogle-api-python-client
are not available throughapt
, they must be installed withpip
.Just run:
If you want it cleaner, you can also install them inside a virtual environment. Let me know if you want that version too!
Regards