无法使用pip install html安装html模块

时间:2020-03-20 18:17:15

标签: python pip

C:\Users\HP>pip install html
Collecting html
  Using cached html-1.16.tar.gz (7.6 kB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\hp\appdata\local\programs\python\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Public\\Documents\\Wondershare\\CreatorTemp\\pip-install-3h28loxi\\html\\setup.py'"'"'; __file__='"'"'C:\\Users\\Public\\Documents\\Wondershare\\CreatorTemp\\pip-install-3h28loxi\\html\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3h28loxi\html\pip-egg-info'
         cwd: C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-3h28loxi\html\
    Complete output (15 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\hp\appdata\local\programs\python\python38\lib\site-packages\setuptools\__init__.py", line 20, in <module>
        from setuptools.depends import Require
      File "c:\users\hp\appdata\local\programs\python\python38\lib\site-packages\setuptools\depends.py", line 6, in <module>
        from .py33compat import Bytecode
      File "c:\users\hp\appdata\local\programs\python\python38\lib\site-packages\setuptools\py33compat.py", line 11, in <module>
        from setuptools.extern.six.moves import html_parser
      File "c:\users\hp\appdata\local\programs\python\python38\lib\site-packages\setuptools\_vendor\six.py", line 92, in __get__
        result = self._resolve()
      File "c:\users\hp\appdata\local\programs\python\python38\lib\site-packages\setuptools\_vendor\six.py", line 115, in _resolve
        return _import_module(self.mod)
      File "c:\users\hp\appdata\local\programs\python\python38\lib\site-packages\setuptools\_vendor\six.py", line 82, in _import_module
        __import__(name)
    ModuleNotFoundError: No module named 'html.parser'; 'html' is not a package
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

1 个答案:

答案 0 :(得分:1)

htmlhtml.parser是标准库中的模块。您不需要安装它们,它们可以在Python安装中使用。

您通过pip install html安装的是https://pypi.org/project/html/,这是一个完全不同的软件包,没有html.parser子软件包。

要解决您的问题,请卸载错误的html

pip uninstall html