You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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 --user to avoid system conflicts):
      pip3 install matplotlib --user
      

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 --user flag 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 10:01:45