#288: 5 Helpful Tricks for UV
The more I use uv, the more I like the great experience this little tool offers. In this post we explore five helpful tricks I learned as I run into some issues along the way.
Clear the cache
One of the great benefits of uv is the cache. If we need to install the same package version again, uv does not download the package, but instead it takes the package from the cache. But what happens if we have a version in the cache that we do not want to reuse? If all else fails, we can purge the whole cache with this command:
With the whole cache gone, we get the chance to reinstall the package from the source – even with uv pip install.
Ignore cached version of a package
If we have an uv project and want to reinstall a package, we can use this command instead of deleting the whole cache:
This will ignore the cached version and reinstall the package, but that only works for uv tool and not for uv pip.
Show the dependency tree
If we want to know the dependencies of the packages we installed into our environment, we can use this handy command:
This gives us a nice tree of our dependencies and the packages they depend on:

Find outdated dependencies of our dependencies
If we want to see how up-to-date our dependencies are, we can use the --outdated option in combination with the dependency tree:
That not only shows the current version and the newest version of our direct dependencies, but also on the packages they themselves depend on:

Reinstall Python
Not all patches to Python result in new version numbers. Therefore, it is a good idea to periodically run this command to reinstall the Python versions that are in the cache of uv:
Next
With these 5 tricks we can get even more out of uv. While the commands above may not be part of you daily work, they are an immense help when one needs them.
Next week we try to access the microphone of our computer through Python code.