因为毕设的需要,最近在安装python需要的相关东西。
磨磨蹭蹭三天了还没安装好,分享一些遇到的坑给大家,帮大家避一避吧
这篇主要分享安装失败,朋友们可以看看有没有相似经历,也可以直接看我后面分享的成功篇
1.Anaconda
一开始下载的anaconda是python3.7的,TensorFlow总是安不上,查资料,说是TensorFlow还不支持python3.7。所以把安装的Anaconda卸载了。下载5.2.0版本,是python3.6的
2.TensorFlow
(1)第一次安装失败
创建tensorflow环境,"conda create -n tensorflow pip python=3.6"
"activate tensorflow"
''pip install --ignore-installed --upgrade tensorflow
很好,第一次安装失败。。。
(2)第二次安装失败
Anaconda prompt环境下进行和(1)相同的操作,报错
"python -m pip install --upgrade pip"对pip进行更新
还是安装失败,查阅资料说是默认的镜像下载太慢,可以用什么豆瓣镜像
(3)第三次安装失败
"pip install tensorflow -i https://pypi.douban.com/simple"
依旧安装失败,查资料说是级别不够,所以在后面加"--user"
"pip install tensorflow -i https://pypi.douban.com/simple --user"
出现了四个Error,没关系,来一个个解决
[1]ERROR: distributed 1.21.8 requires msgpack, which is not installed.
解决:"pip install msgpack"
[2]ERROR: google-auth 1.11.2 has requirement setuptools>=40.3.0, but you'll have setuptools 39.1.0 which is incompatible.
解决:升级setuptools,"pip install --upgrade setuptools"
[3]ERROR: tensorboard 2.1.1 has requirement setuptools>=41.0.0, but you'll have setuptools 39.1.0 which is incompatible.
也是升级setuptools
[4]ERROR: Could not install packages due to an EnvironmentError: [Errno 28] No space left on device
解决:系统盘空间不足,"pip install wrapt --ignore-installed"
(4)第四次。。。
解决完上面的error,再来安装一次,干巴爹
"pip install tensorflow -i https://pypi.douban.com/simple --user"再来一遍!!!
"python"进入python环境,输入"import tensorflow as tf",又报错了。。。
PS:上面这些安装失败的经历我基本在cmd下和anaconda prompt下都试过,所以失败的次数大于上述分享的。
我是python小白,也是第一次接触。。。
下一篇会分享tensorflow初步安装成功后出现的问题,以及解决方法
因为实在下的太慢了,所以安装了好几天,如果大家也是跟我一样,用了以上几种方法还是安装不成功的话,可以试试我下一篇文章推荐的方法。
https://blog.youkuaiyun.com/qq_41041762/article/details/104904373