Your pip broke because the release upgrade replaced the system Python (3.13 to 3.14) but left everything you had installed with pip install --user in ~/.local untouched. Those files were built for 3.13, the pip3 script in ~/.local/bin now shadows the working copy in /usr/bin, and the import fails. The fix is to bypass the stale script, reinstall your user packages under the new interpreter, then clean out the leftovers.
Why a release upgrade breaks user-installed packages
Ubuntu keeps two kinds of Python software apart:
- Distribution packages live in
/usr/lib/python3/dist-packages. During the upgrade, apt rebuilds and replaces all of them for the new interpreter, so they keep working. - Packages you installed yourself with
pip install --userlive in~/.local/lib/python3.X/site-packages, where X.Y is the Python version that was current when you installed them. A release upgrade never touches your home directory.
Python only searches for user-installed modules in the directory matching its own version. Under 3.14 the search path includes ~/.local/lib/python3.14/site-packages — a directory that does not exist yet — and skips the old python3.13 folder entirely. Every module you installed for 3.13 has effectively vanished.
The pip3 command is itself a small script that pip placed in ~/.local/bin. Because ~/.local/bin comes before /usr/bin in PATH, your shell keeps running that old script. Its import can no longer find the matching pip package, so Python falls back to the distribution's pip in /usr/lib/python3/dist-packages, whose internal layout does not match what the script expects — hence the ImportError: cannot import name 'cli'.
Confirm this is your situation
Three quick checks:
python3 --version
ls ~/.local/lib/
which -a pip3
python3 --versionreports 3.14 whilels ~/.local/lib/still shows onlypython3.13.which -a pip3lists~/.local/bin/pip3first; the second entry,/usr/bin/pip3, belongs to the distribution and works.
You can also run python3 -m site and confirm the user site directory now points at python3.14.
Get a working pip immediately
Until you clean up, call the distribution's pip explicitly:
/usr/bin/pip3 --version
# or equivalently
python3 -m pip --version
Then remove the stale shims so the broken copies stop shadowing the good ones:
rm ~/.local/bin/pip3 ~/.local/bin/pip
Do not worry about losing them: a later pip install --user pip recreates the scripts. Note that any other script in ~/.local/bin belonging to a 3.13 package will fail the same way until that package is reinstalled.
Reinstall your packages under Python 3.14
First salvage the list of what you had. Package names can be read from the .dist-info folders in the old site-packages directory:
ls ~/.local/lib/python3.13/site-packages/*.dist-info \
| xargs -n 1 basename | cut -d- -f1 > ~/old-packages.txt
Review the file, drop anything you no longer want, then reinstall everything against the new interpreter:
/usr/bin/pip3 install --user -r ~/old-packages.txt
This recreates ~/.local/lib/python3.14/site-packages and regenerates the console scripts in ~/.local/bin. If pip refuses with an externally-managed-environment error, the release now guards its system Python (PEP 668); in that case prefer a per-project virtual environment or pipx, or pass --break-system-packages only if you accept the risk of clashing with apt-managed modules.
Once everything imports cleanly, delete the orphaned tree:
rm -rf ~/.local/lib/python3.13
Avoid the same breakage next time
- Before a release upgrade, run
python3 -m pip freeze > ~/requirements-backup.txtso you always start from a clean list. - Keep projects in virtual environments created with
python3 -m venv; after an upgrade, recreate each venv and runpip install -r requirements.txtinside it. - Use
pipxfor command-line tools; it isolates each tool in its own venv, andpipx reinstall-allfixes them all after a Python version bump. - Install software that ships in the Ubuntu archive with
aptrather than pip — the upgrade handles those automatically.
Frequently Asked Questions
Can I just rename python3.13 to python3.14 or symlink it?
No. Packages containing compiled extensions are built for one interpreter ABI and will crash or misbehave under another. Reinstalling wheels built for 3.14 is the only reliable route.
Why does python3 still work if pip3 is broken?
/usr/bin/python3 and the modules apt installed were rebuilt for 3.14 during the upgrade. Only the copies in your home directory were left behind, and the stale ~/.local/bin/pip3 script shadows the working /usr/bin/pip3.
Do I need sudo for any of this?
No. Everything under ~/.local belongs to your user. Use sudo only if you deliberately installed packages system-wide rather than with --user.
My virtualenvs stopped working too — why?
A venv symlinks to a specific interpreter and carries its own pip. After the interpreter version changes, recreate the venv and reinstall from your requirements file; the old one cannot be patched reliably.
Is it safe to keep both the python3.13 and python3.14 user directories?
They coexist without conflict, since each interpreter only reads its own folder. Keep the old one until you have confirmed every package was migrated, then delete it to reclaim space.
What if a package has no wheel for 3.14 yet?
pip will try to build from source and may fail if the project has not been updated. Wait for a compatible release, or run that one tool inside a container or an interpreter version manager until upstream catches up.