尝试使用python时终端中的回溯错误

时间:2015-07-30 01:07:26

标签: python traceback

每当我尝试使用终端时,我都会收到此错误。我最初尝试使用pip来安装html5lib,但现在我甚至无法使用python。任何人都知道发生了什么事吗?

Dans-MacBook-Pro:~ DanLee$ python
Traceback (most recent call last):
File "/Users/DanLee/anaconda/lib/python2.7/site.py", line 62, in     <module> 
import os
File "/Users/DanLee/anaconda/lib/python2.7/os.py", line 49, in <module>
import posixpath as path
File "/Users/DanLee/anaconda/lib/python2.7/posixpath.py", line 450, in  <module>
plt.plot(years,gdp, color = 'green', marker = 'o', linestyle = 'solid')
NameError: name 'plt' is not defined
Dans-MacBook-Pro:~ DanLee$ pip install html5lib
Traceback (most recent call last):
File "/Users/DanLee/anaconda/lib/python2.7/site.py", line 62, in <module>
import os
File "/Users/DanLee/anaconda/lib/python2.7/os.py", line 49, in <module>
import posixpath as path
File "/Users/DanLee/anaconda/lib/python2.7/posixpath.py", line 450, in <module>
plt.plot(years,gdp, color = 'green', marker = 'o', linestyle = 'solid')
NameError: name 'plt' is not defined

1 个答案:

答案 0 :(得分:1)

总结评论:

您已安装Anaconda,因此请使用conda安装软件包:

conda install html5lib

当然,您似乎已经以某种方式弄乱了您的Anaconda安装,因此请先重新安装。