简体   繁体   English

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

[英]Traceback error in terminal when trying to use python

I am getting this error whenever I try to use terminal. 每当我尝试使用终端时,我都会收到此错误。 I was initially trying to use pip to install html5lib, but now I can't even use python. 我最初尝试使用pip安装html5lib,但现在我什至不能使用python。 Anyone have any idea what is going on? 有人知道发生了什么吗?

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

Summarizing comments here: 在此处总结评论:

You've installed Anaconda, so use conda to install packages: 您已经安装了Anaconda,因此请使用conda安装软件包:

conda install html5lib

Of course, it seems you've somehow messed up your Anaconda install, so re-install it first. 当然,您似乎已经以某种方式搞砸了Anaconda的安装,因此请先重新安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 每次打开终端时,Python Traceback错误 - Python Traceback Error everytime Terminal is opened 尝试使用无效命令时,在终端中使用Ctrl + C产生python追溯 - Ctrl+C in terminal producing python traceback, on trying an invalid command 尝试使用 while 循环时出现回溯错误和“'int' 类型的参数不可迭代” - Traceback error and “argument of type 'int' is not iterable” when trying to use while loop 尝试从python终端的scapy模块使用“ traceroute”功能时出错。 作业系统:ubuntu 18.04 - Error when trying to use “traceroute” function from the scapy module in python terminal. OS: ubuntu 18.04 使用终端时出现 Python 语法错误 - Python syntax error when I use terminal 在python中读取文件时出现回溯错误 - Traceback error when reading file in python 读取 Json 文件时出现 Python 回溯错误 - Python Traceback Error When Reading Json File 在python上运行elasticsearch和kibana时出现回溯错误 - Traceback error when running elasticsearch and kibana on python Ubuntu运行时Python代码中的Traceback错误 - Traceback Error in Python Code when runs of Ubuntu 在Python中使用子流程时出现回溯错误 - Traceback error when using subprocess in Python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM