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

Problem Description

When using pip to install matplotlib, the error is as follows:

(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> 

solution 

 Simple and rude, directly delete the two folders numpy and numpy-1.21.6.dist-info, and then reinstall numpy.

pip install numpy。

The latter error is also the same solution. According to the provided path, find the corresponding folder, then delete it, and then use pip to install it.

(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'

Guess you like

Origin blog.csdn.net/a1456123a/article/details/128944891