ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory:【已解决】

问题描述

使用pip安装matplotlib时候报错如下:

(cat) PS E:\matlab> pip install matplotlib
Collecting matplotlib
  Downloading matplotlib-3.5.3-cp37-cp37m-win_amd64.whl (7.2 MB)
     ---------------------------------------- 7.2/7.2 MB 747.3 kB/s eta 0:00:00
Collecting fonttools>=4.22.0
  Downloading fonttools-4.38.0-py3-none-any.whl (965 kB)
     ---------------------------------------- 965.4/965.4 kB 1.1 MB/s eta 0:00:00
Requirement already satisfied: packaging>=20.0 in d:\program\anaconda3\envs\cat\lib\site-packages (from matplotlib) (21.3)
Requirement already satisfied: pillow>=6.2.0 in d:\program\anaconda3\envs\cat\lib\site-packages (from matplotlib) (8.2.0)
Requirement already satisfied: python-dateutil>=2.7 in d:\program\anaconda3\envs\cat\lib\site-packages (from matplotlib) (2.8.1)
Requirement already satisfied: numpy>=1.17 in d:\program\anaconda3\envs\cat\lib\site-packages (from matplotlib) (1.21.6)
Requirement already satisfied: kiwisolver>=1.0.1 in d:\program\anaconda3\envs\cat\lib\site-packages (from matplotlib) (1.3.1)
Requirement already satisfied: cycler>=0.10 in d:\program\anaconda3\envs\cat\lib\site-packages (from matplotlib) (0.10.0)
Requirement already satisfied: pyparsing>=2.2.1 in d:\program\anaconda3\envs\cat\lib\site-packages (from matplotlib) (2.4.7)
Collecting six
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'd:\\program\\anaconda3\\envs\\cat\\lib\\site-packages\\numpy-1.21.6.dist-info\\METADATA'

(cat) PS E:\matlab> 

解决方案 

 简单粗暴一点,直接删除numpy和numpy-1.21.6.dist-info这两个文件夹,然后重新安装numpy就可以了。

pip install numpy。

后面的这个错误,也是一样的解决方案,根据提供的路径,找到相应的文件夹,然后删除,再使用pip安装就好。

(cat) PS E:\matlab> pip install pandas
Requirement already satisfied: pandas in d:\program\anaconda3\envs\cat\lib\site-packages (1.2.4)
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'd:\\program\\anaconda3\\envs\\cat\\lib\\site-packages\\pandas-1.2.4.dist-info\\METADATA'

你可能感兴趣的:(pip,python,解决方案,matplotlib,python,matlab,numpy,pip)