How do you install the Python Package html5-parser in a windows environment

Viewed 182

I am trying to build the package, html5-parser for my Windows 10 python environment. I have read the instructions found here: https://html5-parser.readthedocs.io/en/latest/ but find them unclear.

The script that is used to run that package, while readily available from the Github repro doesn't work if run from the directory where it resides in that project. The reference above assumes the script will be run from a windows continuous integration server. Of course, my python development environment is not that.

I don't know how to proceed from here and I'm looking for some step by step instructions on how to build this package.

1 Answers

This is not final solution / answer, but I want to post some steps which can help to achieve final solution.

First, You need to install MSCV build tools, follow this tutorial and make sure You have all the packages.

Then clone html5-parse library: https://github.com/kovidgoyal/html5-parser.git

Move win-ci.py from subfolder .github\workflows to the root folder of the repo (where setup.py is).

Edit win-ci.py and comment out lines:

#env = query_vcvarsall()
#os.environ.update(env)

From functions install_deps() and build().

Now open command line in the repo dictionary and run:
python win-ci.py install

This should install all dependencies.

After this, running python win-ci.py should execute build() function and finish installing of the library.

Unfortunately I had issues to make paths working properly.

After installing build tools I didn't have nmake.exe in path so I had to add it manually:
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64

Then in build() step I've got stuck by missing sttdef.h.
I have library installed in C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt but still couldn't make it work.

Related