Fixing pip and user-installed Python packages after upgrading to Ubuntu 26.04 (Python 3.13 to 3.14)

Abstract: An Ubuntu release upgrade replaces the system Python, orphaning pip and packages you installed in ~/.local for the old version. Here is how to restore pip and migrate your user site-packages to Python 3.14.

Created: 2026-11-17 by

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 --user live 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 --version reports 3.14 while ls ~/.local/lib/ still shows only python3.13.
  • which -a pip3 lists ~/.local/bin/pip3 first; 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.txt so you always start from a clean list.
  • Keep projects in virtual environments created with python3 -m venv; after an upgrade, recreate each venv and run pip install -r requirements.txt inside it.
  • Use pipx for command-line tools; it isolates each tool in its own venv, and pipx reinstall-all fixes them all after a Python version bump.
  • Install software that ships in the Ubuntu archive with apt rather 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.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More