【问题标题】:cannot import name 'HTMLParseError' from 'html.parser'无法从“html.parser”导入名称“HTMLParseError”
【发布时间】:2019-01-12 20:41:50
【问题描述】:
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 namespaces


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      我对这个lib不熟悉,但我猜是你的python路径配置不正确,导致模块要么导入不正确,要么加载不正确。

      【讨论】:

        猜你喜欢
        • 2019-12-30
        • 2016-04-22
        • 1970-01-01
        • 1970-01-01
        • 2021-02-27
        • 2020-09-22
        • 2021-12-04
        • 2021-05-30
        • 2021-11-07
        相关资源
        最近更新 更多