【报错】Could not install packages due to an OSError: [Errno 2] No such file or directory: ‘/METADATA‘

简介: 【报错】Could not install packages due to an OSError: [Errno 2] No such file or directory: ‘/METADATA‘

写在最前面

参考:https://blog.csdn.net/m0_52583356/article/details/129713463

安装命令:

pip install scikit-learn

报错如下:

ERROR: Could not install packages due to an OSError: [Errno 2] 没有那个文件或目录: ‘/home/tjh/miniconda3/envs/pytorch1.12_gpu/lib/python3.9/site-packages/numpy-1.23.4.dist-info/METADATA’

删除“numpy-1.23.4.dist-info”文件夹后,再次安装,成功

解决方案

要根据报错信息找到并删除“numpy-1.23.4.dist-info”文件夹,可以按照以下步骤操作:

  1. 打开终端:首先打开你的终端或命令行工具。
  2. 切换到目标目录:使用cd命令进入到包含有问题的numpy文件夹的路径。根据你的错误信息,路径应该是:
cd /home/tjh/miniconda3/envs/pytorch1.12_gpu/lib/python3.9/site-packages/

确认文件夹存在:在删除任何东西之前,确认“numpy-1.23.4.dist-info”文件夹确实存在。可以使用ls命令查看:

ls | grep numpy-1.23.4.dist-info

删除文件夹:一旦确认文件夹存在,并且你确定要删除它,可以使用rm -r命令来删除整个文件夹:

rm -r numpy-1.23.4.dist-info

  1. 安装或修复Numpy:删除文件夹后,重新安装或修复Numpy以确保一切正常。如果你是用conda安装的,可以使用:
conda install numpy

如果是用pip安装的,可以使用:

pip install numpy --force-reinstall


目录
相关文章
|
6月前
|
Python
.repo/repo/main.py“, line 79 file=sys.stderr) SyntaxError: invalid syntax
.repo/repo/main.py“, line 79 file=sys.stderr) SyntaxError: invalid syntax
161 0
|
缓存 JavaScript
Error: EPERM: operation not permitted, mkdir ‘C:\Program Files\nodejs‘TypeError: Cannot read proper
Error: EPERM: operation not permitted, mkdir ‘C:\Program Files\nodejs‘TypeError: Cannot read proper
134 0
问题提解决:ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host=‘files.pythonhos
问题提解决:ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host=‘files.pythonhos
|
12月前
|
Python
ERROR: file or directory not found: xx.py
​ 1、问题出现原因 在vscode中已导入pytest框架,做自动化demo小测试,运行Python文件一直出现如题错误,截图如下: ERROR: file or directory not found: xx.py  2、解决办法 1)直接把该文件移到当前主目录下,放在PYTHON-STUDY下 2)VSCode中右键tuopan.py文件,选择[在集成终端中打开],或者通过CD命令进入到tuopan.py文件所在目录 然后输入以下命令即可: 注:上述命令不是换行,在d:/前有空格 ,第一行信息为python所在安装路径,空格后的换行为运行的python文件的所在路径  
143 0
|
开发者 Python
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied
410 0
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied
fatal error: X11/extensions/Xvlib.h/Xdbe.h: No such file or directory
fatal error: X11/extensions/Xvlib.h/Xdbe.h: No such file or directory
140 0
configure: error: Package requirements (commoncpp 6.2.2) were not met
configure: error: Package requirements (commoncpp 6.2.2) were not met
83 0
|
Ubuntu
解决办法:GLib-ERROR **: Creating pipes for GWakeup: Too many open files
解决办法:GLib-ERROR **: Creating pipes for GWakeup: Too many open files
172 0
成功解决ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。backend_agg.cp36
成功解决ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。backend_agg.cp36
成功解决ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。backend_agg.cp36
ERROR: Could not install packages due to an Oserror: [Errno 13] Permission denied: RECORD Consider
ERROR: Could not install packages due to an Oserror: [Errno 13] Permission denied: RECORD Consider
1087 0
ERROR: Could not install packages due to an Oserror: [Errno 13] Permission denied: RECORD Consider