python - 无法从 'HTMLParseError' 导入名称 'html.parser'

标签 python namespaces

Exception has occurred: ImportError
cannot import name 'HTMLParseError' from 'html.parser' (/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/html/parser.py)
  File "/Users/asantoshkumar/Desktop/untitled folder/<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/asantoshkumar/Desktop/untitled folder/<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "/Users/asantoshkumar/Desktop/untitled folder/<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/Users/asantoshkumar/Desktop/untitled folder/<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "/Users/asantoshkumar/Desktop/untitled folder/<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "/Users/asantoshkumar/Desktop/untitled folder/<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/asantoshkumar/Desktop/untitled folder/<frozen importlib._bootstrap>", line 1043, in _handle_fromlist

运行以下代码行时出现上述错误。我已经按照 NSEpy 文档安装了所有必要的文件。请帮忙。

代码:
from nsepy import get_history
from datetime import date
sbin = get_history(symbol="SBIN", start=date(2017,1,1), end=date(2019,1,11))
#data[['Close']].plot()
print(sbin)

我已经通过 pip3 install 命令安装了 NSEpy 和所有必要的模块。我正在使用 Mac。
from nsepy import get_history
from datetime import date
sbin = get_history(symbol="SBIN", start=date(2017,1,1), end=date(2019,1,11))
#data[['Close']].plot() print(sbin)

最佳答案

我假设这是一个兼容性错误,其中模块本身有问题。检查模块是否已更新,以及您是否正在运行解释器和模块的最新版本。您可能必须编辑模块本身,这非常耗时。祝你好运!

关于python - 无法从 'HTMLParseError' 导入名称 'html.parser',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54163685/

相关文章:

python - 用 NaN 连接 Pandas 中的两列

Python Pandas 删除过程中出现内存错误

python - mysql-python 停止工作

python - 使用 python 2.7 lxml 中的命名空间访问 xml 文件中的值

Python Pandas : read csv with N columns where N is specified in the some other column

PYTHON - 合并日期索引上的两个数据帧

xml - 向嵌套元素添加命名空间

php - 是否有最佳实践方法来近似 WordPress 插件中的命名空间 PHP?

asp.net-mvc - 命名空间更改 - 发现多个类型与名为 'Home' 的 Controller 匹配

python - 为什么函数可以改变外部的对象?