简体   繁体   中英

How import 'html5lib' package to Python 3.5 Script in Azure Machine Learning Studio?

I'm trying to import the package html5lib to Azure Machine Learning , into a Execute Python Script module. It's a similar question as here , but same solution didn't work... :/

My steps until now:

  1. I got the latest version of HTML5LIB package from the project website ;
  2. Unzip tar.gz file and re-zip as .ZIP file;
  3. Upload the file in Azure Studio as a Dataset named as 'html5lib.zip'; enter image description here
  4. Add the zip file as dataset into my Experiment and connected to Script Bundle Input; enter image description here
  5. Run the following script: enter image description here

Then, I got the error:

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

Any idea how can I fix this?

Thanks in advance.

This worked for me. Ran the following commands on windows command line.

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

This is code in Python Script Module

这是 Python 脚本模块中的代码

This is screenshot of the experiment and success message after executing the experiment

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM