Centos(腾讯云) 安装Tensorflow失败

每次搞环境都是一波三折,血泪交织,废话不多说,直接进入主题

疼讯云自带的python是2.7.5的,后面自己安装过python3.6 所以系统里是python2 python3共存的(pip2 pip3也是共存的)

然后用网上的指令pip3 install tensorflow 报错提示:

rc/python/grpcio/grpc/_cython/cygrpc.cpp:1166:20: fatal error: Python.h: No such file or directory

百度是python环境问题,pip3 install python3-devel解决

然后再执行pip3 install tensorflow 报错提示:

./src/core/ext/filters/client_channel/server_address.h:135:41: error: no matching function for call to ‘StrFormat(const char [3], const uint32_t&)’

百度了半天没有解决,中间就进入了各种摸索,最后解决办法:

卸载原来的python3:yum erase python3(注意千万不要卸载python,否则yum就不能用了,我就被坑了)

安装python3.8(教程:https://blog.csdn.net/fanxl10/article/details/106854062,他改了默认python的链接,我没改,后续还是用python3来执行)

再安装tensorflow:pip3 install tensorflow

终于大功告成!!!

总结:所谓总结都是马后炮,自己干就完事儿了,祝你好运

猜你喜欢

转载自blog.csdn.net/cyfcsd/article/details/116998354
今日推荐