donkey update command updates your car’s core files (manage.py, config.py, etc.) to match the latest version of the Donkeycar templates.
Usage
Arguments
Name of the template to update from. Options: complete, basic, path_follow, cv_control, simulator
Description
When you update the Donkeycar library withpip install --upgrade donkeycar, your car application files don’t automatically update. The update command synchronizes your car files with the newer template.
What gets updated:
manage.py- Main vehicle scriptconfig.py- Default configurationtrain.py- Training scriptcalibrate.py- Calibration script
myconfig.py- Your custom settings (never overwritten)data/- Your training datamodels/- Your trained modelslogs/- Log files
When to Use Update
Rundonkey update when:
-
After upgrading Donkeycar - Sync your car to use new features
- Breaking changes in new version - Ensure compatibility
- Bug fixes in templates - Get fixes to vehicle loop, data collection, etc.
- New template features - Access new parts, modes, or capabilities
- Switching templates - Change from one template type to another
Example Usage
Update to Latest Complete Template
Switch from Basic to Complete Template
Update After Upgrading Donkeycar
How It Works
- Detects current directory - Must be run from your car directory (e.g.,
~/mycar) - Copies template files - Overwrites core files with
--overwrite=True - Preserves myconfig.py - Your customizations remain intact
- Preserves data - All data, models, and logs stay untouched
Before You Update
After You Update
Update myconfig.py if needed
New versions may add new config options. Check
config.py for new settings and add them to myconfig.py if desired.Best Practices
Troubleshooting
Command fails with 'not a directory' error
Command fails with 'not a directory' error
You must run
donkey update from inside your car directory:Lost my custom code
Lost my custom code
If you had custom code in
manage.py that got overwritten:- Check your backup:
manage.py.backup - Or restore from git:
git checkout HEAD~1 manage.py - Manually merge your changes into the new file
- Consider putting custom parts in separate files next time
New config options don't appear
New config options don't appear
myconfig.py is never overwritten by update. New config options appear in config.py only. To use them:- Open
config.pyand find the new settings - Copy them to
myconfig.pywith your desired values - Settings in
myconfig.pyoverride those inconfig.py
Car won't start after update
Car won't start after update
If your car won’t start after updating:
- Check for Python errors:
python manage.py drive - Verify virtual environment is activated
- Check that required parts are still available
- Review myconfig.py for incompatible settings
- Try rolling back:
git checkout HEAD~1
Alternative: Manual Update
Instead of usingdonkey update, you can manually copy files from the Donkeycar templates:
Related Commands
donkey createcar- Create a new car from scratch- Creating Your Application - Initial car setup
Source Code
Implemented indonkeycar/management/base.py:143-157