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

无法卸载numpy:Fedora系统pip卸载权限问题求助

Hey there! I’ve run into similar permission headaches before when mixing sudo with Python package installs, so let’s break this down and get it sorted out.

Why This Happens

Since you installed pandas with sudo, the system-level Python packages (including numpy, which is a core pandas dependency) are owned by the root user. When you try to uninstall with regular pip3, your user account doesn’t have the permissions to delete root-owned files. The "invalid cross-device link" error might pop up if some numpy files are stored across different mounted filesystems on your Fedora system.

Step-by-Step Solutions

1. Uninstall with Sudo (Most Likely Fix)

Run the uninstall command with sudo to gain the necessary root permissions:

sudo pip3 uninstall numpy -vvv --log pip.txt

This should bypass the Errno 13 permission error because you’re acting as the root user who owns the package files.

2. Manual Removal If Cross-Device Links Persist

If the cross-device link error still sticks around, you can manually delete numpy’s installation directory:

  • First, find exactly where numpy is installed:
    pip3 show numpy
    
    Look for the Location line (it’ll look something like /usr/local/lib/python3.6/site-packages).
  • Delete the numpy directory and any related leftover files with sudo:
    sudo rm -rf /usr/local/lib/python3.6/site-packages/numpy*
    
    The * ensures you catch all numpy-related subdirectories and stray files.

3. Verify Uninstallation

Check if numpy is gone for good by running:

pip3 list | grep numpy

If there’s no output, numpy has been successfully uninstalled.

Pro Tip for Future Package Management

As a Python beginner, I’d strongly recommend using virtual environments (like venv or virtualenv) instead of installing packages system-wide with sudo. Virtual environments let you isolate dependencies per project, avoid permission issues entirely, and keep your system Python clean. Here’s a quick start for venv:

# Create a virtual environment for your project
python3 -m venv my_project_env
# Activate it
source my_project_env/bin/activate
# Now install packages without sudo
pip install pandas numpy

When you’re done working, just run deactivate to exit the environment.

内容的提问来源于stack exchange,提问作者audiFanatic

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.28 09:03:25