像上面这样的错误,是因为这一行就已经出现问题了:
DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021. pip 21.0 will remove support for this functionality.
他的意思是Python3.5要挂掉了,所以你不要配置Python3.5,你可以用Python3.8(我的就是3.8),在此之前,你要删掉现在的一些东西,输入下面的指令就好了:
1.退出建立的环境
deactivate
2.删除此环境
conda remove -n tensorflow --all(红色字体改成你的环境名,我设置的是tensorflow)
3.重新建立环境
conda create -n tensorflow1 python=3.8(我的是python=3.8,其他的我不知道,这个3.8可以的)
4.安装tensorflow
pip install tensorflow
5.测试tensorflow(用我的测试吧,网上好多的教程的测试代码都已经老掉牙了,根本没办法用)
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
hello = tf.constant('hello,tensorflow')
sess= tf.compat.v1.Session()
print(sess.run(hello))
参考链接:https://blog.csdn.net/weixin_45935201/article/details/120694522
下面这个也不错,大家可以参考学习学习。避免踩坑,我不知道以后这个东西会不会变化,不过至少我发现之前python=3.5是不行的,我浪费了很多时间,希望大家从我这开始,学习更新的一些东西来解决问题