为什么我无法使用 pip 在 python 中安装后导入转换?

Why I cannot import transformations after installation in python using pip?

我是 运行 python 3.8 并使用 pip 安装许多软件包并导入它。但是当我尝试安装转换并导入它时,我收到以下消息。任何帮助将不胜感激。

C:\Users\r.acharyya.CI\AppData\Local\Programs\Python\Python38>pip 安装转换 要求已满足:在 c:\users\r.acharyya.ci\appdata\local\programs\python\python38\lib\site-packages (0.1)

中转换

C:\Users\buy.rtharyya.CI\AppData\Local\Programs\Python\Python38>pip 安装转换 要求已满足:在 c:\users\r.acharyya.ci\appdata\local\programs\python\python38\lib\site-packages (0.1)

中转换

C:\Users\buy.rtharyya.CI\AppData\Local\Programs\Python\Python38>python Python 3.8.1(tags/v3.8.1:1b293b6,2019 年 12 月 18 日,23:11:46)Win32 上的 [MSC v.1916 64 位 (AMD64)] 键入“帮助”、“版权”、“致谢名单”或“许可”以获取更多信息。

import transforms Traceback (most recent call last): File "", line 1, in File "C:\Users\r.acharyya.CI\AppData\Local\Programs\Python\Python38\lib\site-packages\transforms_init_.py", line 1, in from .safe_html import safe_html, bodyfinder File "C:\Users\r.acharyya.CI\AppData\Local\Programs\Python\Python38\lib\site-packages\transforms\safe_html.py", line 1, in from sgmllib import SGMLParser, SGMLParseError ModuleNotFoundError: No module named 'sgmllib'

transforms, the only version is 0.1 released Aug 21, 2014. The code is obviously Python2-only. sgmllib was a module in the standard library https://docs.python.org/2.7/library/sgmllib.html,自 2.6 版后已弃用。

我使用命令 pip install sgmllib3k 它解决了我的问题。