无法从“”导入名称“HTMLParseError”html.parser'

2024-09-26 17:43:42 发布

您现在位置:Python中文网/ 问答频道 /正文

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文档安装了所有必需的文件。请帮忙。在

代码:

^{pr2}$

我已经通过pip3安装命令安装了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)

Tags: infromimportltgtlineimportlibfolder
2条回答

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

我不熟悉这个库,但我猜您的python路径配置不正确,导致模块无法正确导入或加载。在

相关问题 更多 >

    热门问题