Get Started: Coral USB Accelerator
Complete guide for installing the Coral Edge TPU USB Accelerator on Debian with Python 3.13
- Debian-based system (Debian, Ubuntu, Raspberry Pi OS)
- Python 3.13 (or higher) as system Python
- Internet connection
- Root privileges (sudo)
Table of Contents
1. Install Edge TPU Runtime
The Edge TPU Runtime is the driver software your system needs to communicate with the Coral USB Accelerator.
Add Repository Key
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/coral-edgetpu.gpg
curldownloads the cryptographic key from Googlegpg --dearmorconverts it to binary format- The key is stored in
/usr/share/keyrings/ - Your system can verify that Coral packages are authentic
Add Repository to Package List
echo "deb [signed-by=/usr/share/keyrings/coral-edgetpu.gpg] https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
- Adds the Coral repository to your package sources
[signed-by=...]references the previously saved key- The file is stored in
/etc/apt/sources.list.d/
Update Package Lists and Install Runtime
sudo apt-get update
sudo apt-get install libedgetpu1-std
libedgetpu1-std = Standard version (recommended, runs cooler)libedgetpu1-max = Maximum performance (runs hotter)
2. Install pyenv
Since PyCoral only supports Python 3.9, but your system has Python 3.13, we'll use pyenv to manage multiple Python versions in parallel.
Install Build Dependencies
These packages are needed to compile Python from source:
sudo apt-get update
sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev git
build-essential: Compiler (gcc, make) to compile C codelibssl-dev: Encryption (for HTTPS)zlib1g-dev: Compression (for ZIP)libreadline-dev: Interactive Python shell with arrow keys- and other libraries Python requires
Download and Install pyenv
curl https://pyenv.run | bash
Add pyenv to Shell
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
Reload shell:
source ~/.bashrc
.bashrc with .zshrc
3. Install Python 3.9
Now we'll compile Python 3.9.18 with pyenv:
pyenv install 3.9.18
This step takes 5-20 minutes, depending on your processor. Python is compiled from source. The terminal often shows nothing for a long time — this is normal!
4. Set up Virtual Environment
Now we'll create a project folder and set up an isolated virtual environment:
Create Project Folder
mkdir ~/coral-project
cd ~/coral-project
Set Python 3.9 for This Project
pyenv local 3.9.18
Verify:
python --version
Python 3.9.18
Create Virtual Environment
python -m venv coral-env
Activate Virtual Environment
source coral-env/bin/activate
Your terminal prompt should now show (coral-env) at the beginning.
- Isolated Python environment for your project
- All installed packages stay in this folder
- No version conflicts with other projects
- Easy to delete and recreate
5. Install PyCoral
Now we'll install PyCoral and all required packages in the virtual environment:
Install NumPy 1.x
pip install "numpy<2"
Install PyCoral
pip install --extra-index-url https://google-coral.github.io/py-repo/ pycoral~=2.0
This automatically also installs:
tflite-runtime(TensorFlow Lite)pillow(Image processing)- Other required dependencies
6. Test Installation
Let's verify that everything works!
Download Test Data
mkdir -p test_data examples
cd ~/coral-project
# Example script
wget https://raw.githubusercontent.com/google-coral/pycoral/master/examples/classify_image.py -O examples/classify_image.py
# Model and labels
wget https://github.com/google-coral/test_data/raw/master/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite -O test_data/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite
wget https://github.com/google-coral/test_data/raw/master/inat_bird_labels.txt -O test_data/inat_bird_labels.txt
# Test image
wget https://github.com/google-coral/test_data/raw/master/parrot.jpg -O test_data/parrot.jpg
Connect USB Accelerator
Now plug in your Coral USB Accelerator. The LED should light up.
Run Classification
python examples/classify_image.py \
--model test_data/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite \
--labels test_data/inat_bird_labels.txt \
--input test_data/parrot.jpg
Ara macao (Scarlet Macaw): 0.75781or similar bird species with probabilities
Done!
Your Coral USB Accelerator is now ready to use!
Next Steps
- Explore more examples: PyCoral Examples
- Train your own models: Coral Model Guide
- Use pre-trained models: Coral Model Zoo
Useful Commands
| Action | Command |
|---|---|
| Activate virtual environment | source ~/coral-project/coral-env/bin/activate |
| Deactivate virtual environment | deactivate |
| Check Python version | python --version |
| Show installed packages | pip list |
| Edge TPU detected? | lsusb | grep "Global Unichip" |
Troubleshooting
Problem: "No module named 'pycoral'"
Solution: Make sure the virtual environment is activated:
source ~/coral-project/coral-env/bin/activate
Problem: "Failed to load delegate from libedgetpu.so.1"
Solution: Edge TPU Runtime not installed or USB not connected:
sudo apt-get install libedgetpu1-std
lsusb | grep "Global Unichip"
Problem: NumPy 2.0 Error
Solution: Downgrade NumPy to version 1.x:
pip install "numpy<2"
Problem: Python 3.9 Installation Fails
Solution: Check build dependencies and install readline:
sudo apt-get install libreadline-dev
pyenv uninstall 3.9.18
pyenv install 3.9.18