执行python代码报错(AttributeError: 'NoneType' object has no attribute 'magic')
和平战马 2017-10-13 11:32:54 执行python代码报错,在网上查了很久,都没有查到解决办法,请大神指导一下!谢谢!
[root@master dataannl]# python -V
Python 3.6.2
[root@master dataannl]#
[root@master dataannl]#
[root@master dataannl]# cat example01.py
# -*- coding: utf-8 -*-
# from pandas import Series,DataFrame
# import pandas as pd
from IPython import get_ipython
import matplotlib.pyplot as plt
get_ipython().magic(u'matplotlib inline')
plt.ylabel('True Positive Rate') #坐标轴标签
plt.ylim(0,1.05) #边界范围
plt.xlim(0,1.05) #边界范围
plt.legend(loc=4) #图例
plt.show() #显示作图结果
[root@master dataannl]#
[root@master dataannl]# python example01.py
Traceback (most recent call last):
File "example01.py", line 8, in <module>
get_ipython().magic(u'matplotlib inline')
AttributeError: 'NoneType' object has no attribute 'magic'
[root@master dataannl]#