I’m having trouble with a Python script that connects to Airtable’s API. When I try to run my code, I keep getting an error saying the airtable module cannot be found.
I set up a virtual environment and created a file called fetch_records.py with this code:
import requests
from airtable import airtable
api_client = airtable.Airtable('appB4x9YYp3KzmqTw', 'YOUR_API_TOKEN')
api_client.get('Projects')
When I execute the script, I get this error message:
(myenv) PS C:\Dev\python_scripts\myenv> python fetch_records.py
Traceback (most recent call last):
File "fetch_records.py", line 2, in <module>
from airtable import airtable
ModuleNotFoundError: No module named 'airtable'
What am I missing here? I’m pretty new to working with APIs in Python so I might have skipped something basic. Any help would be great!