vscode、pip install tensorflow下载报错

报错:ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'C:\\Users\\ABC\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\site-packages\\tensorflow\\include\\external\\com_github_grpc_grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\client_load_reporting_filter.h'
HINT: This error might have occurred since this system does not have Windows Long Path support enabled. You can find information on how to enable this at https://pip.pypa.io/warnings/enable-long-paths

这个错误信息表明在尝试安装TensorFlow时遇到了文件路径长度问题。具体来说,错误信息提示“没有这样的文件或目录”,这通常是因为Windows系统中的路径长度限制导致的。在Windows系统中,传统上路径长度限制为260个字符(称为MAX_PATH限制),如果路径超过这个长度,就会导致这种错误。

解决:

win+x打开具有管理员权限的PowerShell窗口,运行

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

之后再pip install tensorflow

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值