0

我正在尝试将包导入到html5lib模块中。这是一个与此处类似的问题,但相同的解决方案不起作用......:/Azure Machine LearningExecute Python Script

到目前为止我的步骤:

  1. 我从项目网站HTML5LIB获得了最新版本的软件包;
  2. 解压缩 tar.gz 文件并重新压缩为 .ZIP 文件;
  3. 将 Azure Studio 中的文件作为名为“html5lib.zip”的数据集上传; 在此处输入图像描述
  4. 将 zip 文件作为数据集添加到我的实验中并连接到 Script Bundle Input; 在此处输入图像描述
  5. 运行以下脚本: 在此处输入图像描述

然后,我得到了错误:

Error 0085: The following error occurred during script evaluation, please view the output log for more information:
---------- Start of error message from Python interpreter ----------
Caught exception while executing function: Traceback (most recent call last):
File "C:\server\invokepy.py", line 189, in batch
mod = import_module(moduleName)
File "C:\pyhome\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 662, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "C:\temp\6d718116a1f549e59a5b96c5d6360911.py", line 22, in <module>
import html5lib
ImportError: No module named 'html5lib'
Process returned with non-zero exit code 1

知道如何解决这个问题吗?

提前致谢。

4

1 回答 1

0

这对我有用。在 windows 命令行上运行以下命令。

mkdir html5lib
# cd into above directory
pip install html5lib --target=.
# Zip the contents of the directory html5lib.zip

这是 Python 脚本模块中的代码

这是 Python 脚本模块中的代码

这是执行实验后的实验截图和成功信息

这是执行实验后的实验截图和成功信息

于 2018-12-24T10:48:44.310 回答