记录-在python3.9.13中安装tensorflow时遇到的问题

记录22.6.5--在python3.9.13中安装tensorflow时遇到的问题

使用pip在命令行安装tensorflow 报错

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: ‘C:\Users\86136\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\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

在这里插入图片描述
解决办法:
从 Windows 10 版本 1607 开始,MAX_PATH限制已从常见的 Win32 文件和目录函数中删除,因此需要启用长路径。

win+r打开运行界面,键入REGEDIT,找到以下位置:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem。

找到LongPathsEnabled的条目,双击打开,在“值”数据字段中,输入值1。这将启用“长路径”选项。
记录-在python3.9.13中安装tensorflow时遇到的问题_第1张图片
使用豆瓣源加速安装:

pip3 install --user --upgrade tensorflow -i https://pypi.douban.com/simple

你可能感兴趣的:(tensorflow,人工智能,python)