1.matplotlib画图报错AttributeError: ‘module’ object has no attribute ‘popall’
解决方法如下:
原版本1.2.0升级成2.0.2
rpm -e python-matplotlib-1.2.0-15.el7.x86_64
pip install matplotlib==2.0.2
2.解码错误UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe5 in position 108: ordinal not in range
解决方法:代码快里设置字符集为utf8
import sys
reload(sys)
sys.setdefaultencoding('utf8')
3.用tensorflow或者caffe做机器学习时
RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9
基本上都是numpy版本的问题
解决方法
pip list|grep numpy
pip install numpy==1.3.1(视具体情况)
4.python编译碰到错误
configure: error: no acceptable C compiler found in $PATH
原因缺少编译器
安装gcc即可
yum install -y gcc*
本文介绍了解决matplotlib绘图错误、TensorFlow和Caffe运行时的环境配置问题、Python编译错误的方法,包括升级matplotlib版本、设置正确的字符集、调整numpy版本以及安装必要的编译器。
2492

被折叠的 条评论
为什么被折叠?



