Ubuntu 16.04:升级matplotlib后pip与软件更新器故障求助
Fixing Broken Pip & Ubuntu Software Updater After Matplotlib Upgrade
Hey there, let’s work through this problem step by step. Since your pip stopped working entirely after upgrading matplotlib, that’s the core issue we need to fix first—once pip is back up, the Ubuntu Software Updater problem should resolve itself as you suspected.
Step 1: Reinstall Pip Using System Packages
Since pip is unresponsive, we’ll skip using it entirely and restore a working version via Ubuntu’s official repositories:
- First, wipe any corrupted pip installations:
sudo apt remove --purge python3-pip sudo apt autoremove - Reinstall a fresh, system-managed pip:
sudo apt update sudo apt install python3-pip - Verify it’s working by running:
pip3 --version
Step 2: Clean Up Matplotlib Installation
Now that pip is functional, let’s fix the matplotlib upgrade that triggered the issue:
- Uninstall the problematic version:
pip3 uninstall matplotlib -y - Choose one of these options to reinstall (pick based on your needs):
- System-wide stable version (safer for Ubuntu’s dependencies):
sudo apt install python3-matplotlib - Latest version (use
--userto avoid system conflicts):pip3 install matplotlib --user
- System-wide stable version (safer for Ubuntu’s dependencies):
Step 3: Restore Ubuntu Software Updater
Once pip is fixed, the Software Updater should start working again automatically. If it’s still stuck:
- Refresh package lists manually:
sudo apt update sudo apt upgrade -y - Reset the updater’s configuration:
sudo dpkg-reconfigure software-properties-common - Restart the update service:
sudo systemctl restart apt-daily.service apt-daily-upgrade.service
Pro Tips to Avoid This Later
- Always use the
--userflag when installing packages via pip for your own projects—it keeps your user-level libraries separate from Ubuntu’s system Python files:pip3 install [package-name] --user - For project-specific environments, use
venv(built into Python) to isolate dependencies and avoid messing with system-wide tools.
内容的提问来源于stack exchange,提问作者Mr. T
相关产品推荐
相关产品推荐

