一个简单的问题。当我使用 pip 安装或升级软件包时,我收到一个非常奇怪的错误。输入:
pip3 install numpy
输出:
Defaulting to user installation because normal site-packages is not writeable
WARNING: Ignoring invalid distribution -etuptools (/home/max/.local/lib/python3.8/site-packages)
WARNING: Ignoring invalid distribution -etuptools (/home/max/.local/lib/python3.8/site-packages)
Requirement already satisfied: numpy in /home/max/.local/lib/python3.8/site-packages (1.20.2)
WARNING: Ignoring invalid distribution -etuptools (/home/max/.local/lib/python3.8/site-packages)
WARNING: Ignoring invalid distribution -etuptools (/home/max/.local/lib/python3.8/site-packages)
WARNING: Ignoring invalid distribution -etuptools (/home/max/.local/lib/python3.8/site-packages)
知道发生什么事了吗?
操作系统:Ubuntu 20.04
Python:3.8.5
设置池:56.0.0
答案1
转到您的 site-packages 文件夹(在您的情况下为:/home/max/.local/lib/python3.8/site-packages)并删除带有“~”的文件夹。
你会在那里找到~etuptools
答案2
看起来 numpy 已经安装成功。您是否尝试过使用类似以下命令访问它:
python3
>>> import numpy
>>> a=numpy.zeros(10,numpy.uint8,"C")
>>> a
array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=uint8)
>>>