未分类
安装python模块常见错误及解决方式
安装python模块常见错误 matplotlib报错_tkinter.TclError: no display name and no $DISPLAY environment variable
1 2 3 |
import matplotlib import matplotlib.pyplot as plt fig=plt.figure() |
#交互式测试,此时报错 解决办法,在引用后添加下面这一行
1 |
matplotlib.use('Agg') |
例如:
1 2 3 4 |
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt fig=plt.figure() |
报错: c/_cffi_backend.c:15:10: fatal error: ffi.h: 没有那个文件或目录 #include <ffi.h> ^~~~~~~ compilation terminated. error: command ‘gcc’ failed with exit status 1 解决:
1 2 3 |
yum install -y libffi-devel python-devel 或ubuntu中 apt-get install -y libffi-dev python-dev libevent-dev |
报错:build/temp.linux-x86_64-3.4/_openssl.c:423:30: fatal error: openssl/opensslv.h: No such file or directory
1 |
apt-get install libssl-dev |
安装MySQL-python时报错ModuleNotFoundError: No module Read more…