Using lxml for Python - Windows 7 64-bit - python

When I try to install lxml, I get the following. I've tried downloading C++ redists and a whole bunch of other things I've found, but nothing works.
I've tried everything from the following link:
How to install lxml on Windows
I've got python version 3.5.1. I
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\daniel.bak>pip install setuptools
Requirement already satisfied (use --upgrade to upgrade): setuptools in c:\users\daniel.bak\appdata\local\programs\python\python35-32\lib\site-packages
C:\Users\daniel.bak>pip install lxml
Collecting lxml
Using cached lxml-3.6.0.tar.gz
Installing collected packages: lxml
Running setup.py install for lxml ... error
Complete output from command c:\users\daniel.bak\appdata\local\programs\python\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\daniel.bak\\AppData\\Local\\Temp\\pip-build-_d7bp49n\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replac
e('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\daniel.bak\AppData\Local\Temp\pip-4wmqb1li-record\install-record.txt --single-version-externally-managed --compile:
Building lxml version 3.6.0.
Building without Cython.
ERROR: b"'xslt-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
running install
running build
running build_py
creating build
creating build\lib.win32-3.5
creating build\lib.win32-3.5\lxml
copying src\lxml\builder.py -> build\lib.win32-3.5\lxml
copying src\lxml\cssselect.py -> build\lib.win32-3.5\lxml
copying src\lxml\doctestcompare.py -> build\lib.win32-3.5\lxml
copying src\lxml\ElementInclude.py -> build\lib.win32-3.5\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win32-3.5\lxml
copying src\lxml\sax.py -> build\lib.win32-3.5\lxml
copying src\lxml\usedoctest.py -> build\lib.win32-3.5\lxml
copying src\lxml\_elementpath.py -> build\lib.win32-3.5\lxml
copying src\lxml\__init__.py -> build\lib.win32-3.5\lxml
creating build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win32-3.5\lxml\includes
creating build\lib.win32-3.5\lxml\html
copying src\lxml\html\builder.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\clean.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\defs.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\diff.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win32-3.5\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win32-3.5\lxml\html
creating build\lib.win32-3.5\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win32-3.5\lxml\isoschematron
copying src\lxml\lxml.etree.h -> build\lib.win32-3.5\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win32-3.5\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\etreepublic.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\relaxng.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\schematron.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\tree.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\xmlerror.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\xmlparser.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\xmlschema.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\xpath.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win32-3.5\lxml\includes
copying src\lxml\includes\lxml-version.h -> build\lib.win32-3.5\lxml\includes
creating build\lib.win32-3.5\lxml\isoschematron\resources
creating build\lib.win32-3.5\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win32-3.5\lxml\isoschematron\resources\rng
creating build\lib.win32-3.5\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl
creating build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
error: Unable to find vcvarsall.bat
----------------------------------------
Command "c:\users\daniel.bak\appdata\local\programs\python\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\daniel.bak\\AppData\\Local\\Temp\\pip-build-_d7bp49n\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file_
_, 'exec'))" install --record C:\Users\daniel.bak\AppData\Local\Temp\pip-4wmqb1li-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\daniel.bak\AppData\Local\Temp\pip-build-_d7bp49n\lxml\
Installing the precompiled binaries gives me:
C:\Users\daniel.bak>pip install "C:\Users\daniel.bak\Downloads\lxml-3.6.0-cp35-cp35m-win_amd64.whl"
lxml-3.6.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.

You can download precompiled binaries and install them with pip install
Here is the download link. cp27, cp34, cp35 indicate Python versions and win32 and win_amd64 32 and 64 bit packages.

I was having trouble installing lxml on my system as well along with urllib. I do not remember why but lxml was not available for python 3.5, urllib itself is not available but instead it is available as urllib.requests and another package that I do not remember. For me the best solution was to install anaconda instead. Anaconda has just so many libraries and it works greatly in place of python. It has the whole url library and a comprehension of several other libraries.

Related

How can I get rid of the lxml download error?

Then i download lxml with command pip install lxml in visual studio code i get this mistake:
Collecting lxml
Using cached lxml-4.9.1.tar.gz (3.4 MB)
Preparing metadata (setup.py) ... done
Installing collected packages: lxml
DEPRECATION: lxml is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
Running setup.py install for lxml ... error
error: subprocess-exited-with-error
× Running setup.py install for lxml did not run successfully.
│ exit code: 1
╰─> [76 lines of output]
Building lxml version 4.9.1.
Building without Cython.
Building against pre-built libxml2 andl libxslt libraries
running install
C:\Users\79628\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\lxml
copying src\lxml\builder.py -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\cssselect.py -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\doctestcompare.py -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\ElementInclude.py -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\sax.py -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\usedoctest.py -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\_elementpath.py -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\__init__.py -> build\lib.win-amd64-cpython-311\lxml
creating build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win-amd64-cpython-311\lxml\includes
creating build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\builder.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\clean.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\defs.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\diff.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win-amd64-cpython-311\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win-amd64-cpython-311\lxml\html
creating build\lib.win-amd64-cpython-311\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win-amd64-cpython-311\lxml\isoschematron
copying src\lxml\etree.h -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\etree_api.h -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\lxml.etree.h -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-cpython-311\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\__init__.pxd -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-cpython-311\lxml\includes
copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-cpython-311\lxml\includes
creating build\lib.win-amd64-cpython-311\lxml\isoschematron\resources
creating build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\rng
creating build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl
creating build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-cpython-311\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> lxml
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Other libraries download fine except lxml
How can i get rid of it? Maybe someone faced such a problem?
I also try it in pycharm, but it didn't work too.
I need in visual studio code.
I will be very grateful for the solution
Did you see this part of the error message:
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
You need the Visual C++ compiler to build this package on your computer.

Running into an error when trying to pip install python-docx

I just did a fresh install of windows to clean up my computer, moved everything over to my D drive and installed Python through Windows Store (somehow it defaulted to my C drive, so I left it there because Pycharm was getting confused about its location), now I'm trying to pip install the python-docx module for the first time and I'm stuck. I have a recent version of Microsoft C++ Visual Build Tools installed. Excuse me for any irrelevant information I provided, just wishing to be thorough. Here's what's returning in command:
.>pip install python-docx
Collecting python-docx
Using cached python-docx-0.8.11.tar.gz (5.6 MB)
Preparing metadata (setup.py) ... done
Collecting lxml>=2.3.2
Using cached lxml-4.6.3.tar.gz (3.2 MB)
Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for python-docx, since package 'wheel' is not installed.
Using legacy 'setup.py install' for lxml, since package 'wheel' is not installed.
Installing collected packages: lxml, python-docx
Running setup.py install for lxml ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\cahez\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\cahez\\AppData\\Local\\Temp\\pip-install-8rz9vrlv\\lxml_69e9fa188fd042d6953641882e4b3a17\\setup.py'"'"'; __file__='"'"'C:\\Users\\cahez\\AppData\\Local\\Temp\\pip-install-8rz9vrlv\\lxml_69e9fa188fd042d6953641882e4b3a17\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\cahez\AppData\Local\Temp\pip-record-xpg_v_i_\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\cahez\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Include\lxml'
cwd: C:\Users\cahez\AppData\Local\Temp\pip-install-8rz9vrlv\lxml_69e9fa188fd042d6953641882e4b3a17\
Complete output (76 lines):
Building lxml version 4.6.3.
Building without Cython.
Building against pre-built libxml2 andl libxslt libraries
running install
C:\Users\cahez\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-3.10
creating build\lib.win-amd64-3.10\lxml
copying src\lxml\builder.py -> build\lib.win-amd64-3.10\lxml
copying src\lxml\cssselect.py -> build\lib.win-amd64-3.10\lxml
copying src\lxml\doctestcompare.py -> build\lib.win-amd64-3.10\lxml
copying src\lxml\ElementInclude.py -> build\lib.win-amd64-3.10\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-3.10\lxml
copying src\lxml\sax.py -> build\lib.win-amd64-3.10\lxml
copying src\lxml\usedoctest.py -> build\lib.win-amd64-3.10\lxml
copying src\lxml\_elementpath.py -> build\lib.win-amd64-3.10\lxml
copying src\lxml\__init__.py -> build\lib.win-amd64-3.10\lxml
creating build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win-amd64-3.10\lxml\includes
creating build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\builder.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\clean.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\defs.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\diff.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win-amd64-3.10\lxml\html
creating build\lib.win-amd64-3.10\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win-amd64-3.10\lxml\isoschematron
copying src\lxml\etree.h -> build\lib.win-amd64-3.10\lxml
copying src\lxml\etree_api.h -> build\lib.win-amd64-3.10\lxml
copying src\lxml\lxml.etree.h -> build\lib.win-amd64-3.10\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-3.10\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\__init__.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-3.10\lxml\includes
creating build\lib.win-amd64-3.10\lxml\isoschematron\resources
creating build\lib.win-amd64-3.10\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\rng
creating build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl
creating build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\cahez\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\cahez\\AppData\\Local\\Temp\\pip-install-8rz9vrlv\\lxml_69e9fa188fd042d6953641882e4b3a17\\setup.py'"'"'; __file__='"'"'C:\\Users\\cahez\\AppData\\Local\\Temp\\pip-install-8rz9vrlv\\lxml_69e9fa188fd042d6953641882e4b3a17\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\cahez\AppData\Local\Temp\pip-record-xpg_v_i_\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\cahez\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Include\lxml' Check the logs for full command output.
One of the dependencies for python-docx is lxml. The latest stable version of lxml is 4.6.3, released on March 21, 2021. On PyPI there is no lxml wheel for 3.10, yet. So it try to compile from source and for that Microsoft Visual C++ 14.0 or greater is required, as stated in the error.
However you can manually install lxml, before install python-docx. Download and install unofficial binary from Gohlke
Alternatively you can use pipwin to install it from Gohlke. Note there may still be problems with dependencies for lxml.
Of course, you can also downgrade to python3.9.
EDIT: As of 14 Dec 2021 the latest lxml version 4.7.1 supports python 3.10

pip install cx_Freeze command not working

pip install cx_Freeze
Gives this error:-
Collecting cx_Freeze
Using cached https://files.pythonhosted.org/packages/5f/16/eab51d6571dfec2554248cb027c51babd04d97f594ab6359e0707361297d/cx_Freeze-5.1.1.tar.gz
Installing collected packages: cx-Freeze
Running setup.py install for cx-Freeze ... error
ERROR: Complete output from command 'c:\users\alok\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Alok\\AppData\\Local\\Temp\\pip-install-y2cpdbhl\\cx-Freeze\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Alok\AppData\Local\Temp\pip-record-7yj276ze\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\common.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\dist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\finder.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\freezer.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\hooks.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\macdist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\main.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\setupwriter.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\windist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\__init__.py -> build\lib.win32-3.7\cx_Freeze
creating build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\Console.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\ConsoleSetLibPath.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\SharedLib.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\SharedLibSource.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\__startup__.py -> build\lib.win32-3.7\cx_Freeze\initscripts
creating build\lib.win32-3.7\cx_Freeze\samples
creating build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\advanced_1.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\advanced_2.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
creating build\lib.win32-3.7\cx_Freeze\samples\asmodule
copying cx_Freeze\samples\asmodule\asmodule.py -> build\lib.win32-3.7\cx_Freeze\samples\asmodule
copying cx_Freeze\samples\asmodule\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\asmodule
creating build\lib.win32-3.7\cx_Freeze\samples\matplotlib
copying cx_Freeze\samples\matplotlib\matplotlib_eg.py -> build\lib.win32-3.7\cx_Freeze\samples\matplotlib
copying cx_Freeze\samples\matplotlib\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\matplotlib
creating build\lib.win32-3.7\cx_Freeze\samples\openpyxl
copying cx_Freeze\samples\openpyxl\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\openpyxl
copying cx_Freeze\samples\openpyxl\test_openpyxl.py -> build\lib.win32-3.7\cx_Freeze\samples\openpyxl
creating build\lib.win32-3.7\cx_Freeze\samples\PyQt4
copying cx_Freeze\samples\PyQt4\PyQt4app.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt4
copying cx_Freeze\samples\PyQt4\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt4
creating build\lib.win32-3.7\cx_Freeze\samples\PyQt5
copying cx_Freeze\samples\PyQt5\PyQt5app.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt5
copying cx_Freeze\samples\PyQt5\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt5
creating build\lib.win32-3.7\cx_Freeze\samples\relimport
copying cx_Freeze\samples\relimport\relimport.py -> build\lib.win32-3.7\cx_Freeze\samples\relimport
copying cx_Freeze\samples\relimport\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\relimport
creating build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\Config.py -> build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\ServiceHandler.py -> build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\service
creating build\lib.win32-3.7\cx_Freeze\samples\simple
copying cx_Freeze\samples\simple\hello.py -> build\lib.win32-3.7\cx_Freeze\samples\simple
copying cx_Freeze\samples\simple\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\simple
creating build\lib.win32-3.7\cx_Freeze\samples\Tkinter
copying cx_Freeze\samples\Tkinter\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\Tkinter
copying cx_Freeze\samples\Tkinter\SimpleTkApp.py -> build\lib.win32-3.7\cx_Freeze\samples\Tkinter
creating build\lib.win32-3.7\cx_Freeze\samples\wx
copying cx_Freeze\samples\wx\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\wx
copying cx_Freeze\samples\wx\wxapp.py -> build\lib.win32-3.7\cx_Freeze\samples\wx
creating build\lib.win32-3.7\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\qotd.py -> build\lib.win32-3.7\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\zope
running build_ext
building 'cx_Freeze.util' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command "'c:\users\alok\appdata\local\programs\python\python3 error: Microsoft Visual C++ 14.0 is required. G;__file__='"'"'C:soft Visual C++ Build Tools": https://visualstudio.cpdbhl\\cx-Freezenloads/ open)(__file__); ---------------------------------------- ;f.close();exec(cERROR: Command "'c:\users\alok\appdata\local\prograrecord 'C:\Users\7-32\python.exe' -u -c 'import setuptools, tokenize\\Users\\Alok\\AppData\\Local\\Temp\\pip-install-y2\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"',code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"')ompile(code, __file__, '"'"'exec'"'"'))' install --Alok\AppData\Local\Temp\pip-record-7yj276ze\installngle-version-externally-managed --compile" failed win C:\Users\Alok\AppData\Local\Temp\pip-install-y2c
pip install wheel
Then downloading the cx_Freeze for python3.7 for a 32 bit system
then in that path using cmd pip install cx_Freeze-5.1.1-cp37-cp37m-win32.whl
1.)pip install cx_Freeze
2.)pip install wheel
pip install cx_Freeze-5.1.1-cp37-cp37m-win32.whl
When i follow the link it leads to installing a .rar file when I try running the command pip install cx_Freeze then it gives the following error,
Running setup.py install for cx-Freeze ... error
ERROR: Complete output from command 'c:\users\alok\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Alok\\AppData\\Local\\Temp\\pip-install-5ojtpx8i\\cx-Freeze\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Alok\AppData\Local\Temp\pip-record-9oe_iyi5\install-record.txt' --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\common.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\dist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\finder.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\freezer.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\hooks.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\macdist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\main.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\setupwriter.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\windist.py -> build\lib.win32-3.7\cx_Freeze
copying cx_Freeze\__init__.py -> build\lib.win32-3.7\cx_Freeze
creating build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\Console.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\ConsoleSetLibPath.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\SharedLib.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\SharedLibSource.py -> build\lib.win32-3.7\cx_Freeze\initscripts
copying cx_Freeze\initscripts\__startup__.py -> build\lib.win32-3.7\cx_Freeze\initscripts
creating build\lib.win32-3.7\cx_Freeze\samples
creating build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\advanced_1.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\advanced_2.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
copying cx_Freeze\samples\advanced\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\advanced
creating build\lib.win32-3.7\cx_Freeze\samples\asmodule
copying cx_Freeze\samples\asmodule\asmodule.py -> build\lib.win32-3.7\cx_Freeze\samples\asmodule
copying cx_Freeze\samples\asmodule\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\asmodule
creating build\lib.win32-3.7\cx_Freeze\samples\matplotlib
copying cx_Freeze\samples\matplotlib\matplotlib_eg.py -> build\lib.win32-3.7\cx_Freeze\samples\matplotlib
copying cx_Freeze\samples\matplotlib\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\matplotlib
creating build\lib.win32-3.7\cx_Freeze\samples\openpyxl
copying cx_Freeze\samples\openpyxl\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\openpyxl
copying cx_Freeze\samples\openpyxl\test_openpyxl.py -> build\lib.win32-3.7\cx_Freeze\samples\openpyxl
creating build\lib.win32-3.7\cx_Freeze\samples\PyQt4
copying cx_Freeze\samples\PyQt4\PyQt4app.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt4
copying cx_Freeze\samples\PyQt4\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt4
creating build\lib.win32-3.7\cx_Freeze\samples\PyQt5
copying cx_Freeze\samples\PyQt5\PyQt5app.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt5
copying cx_Freeze\samples\PyQt5\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\PyQt5
creating build\lib.win32-3.7\cx_Freeze\samples\relimport
copying cx_Freeze\samples\relimport\relimport.py -> build\lib.win32-3.7\cx_Freeze\samples\relimport
copying cx_Freeze\samples\relimport\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\relimport
creating build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\Config.py -> build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\ServiceHandler.py -> build\lib.win32-3.7\cx_Freeze\samples\service
copying cx_Freeze\samples\service\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\service
creating build\lib.win32-3.7\cx_Freeze\samples\simple
copying cx_Freeze\samples\simple\hello.py -> build\lib.win32-3.7\cx_Freeze\samples\simple
copying cx_Freeze\samples\simple\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\simple
creating build\lib.win32-3.7\cx_Freeze\samples\Tkinter
copying cx_Freeze\samples\Tkinter\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\Tkinter
copying cx_Freeze\samples\Tkinter\SimpleTkApp.py -> build\lib.win32-3.7\cx_Freeze\samples\Tkinter
creating build\lib.win32-3.7\cx_Freeze\samples\wx
copying cx_Freeze\samples\wx\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\wx
copying cx_Freeze\samples\wx\wxapp.py -> build\lib.win32-3.7\cx_Freeze\samples\wx
creating build\lib.win32-3.7\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\qotd.py -> build\lib.win32-3.7\cx_Freeze\samples\zope
copying cx_Freeze\samples\zope\setup.py -> build\lib.win32-3.7\cx_Freeze\samples\zope
running build_ext
building 'cx_Freeze.util' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command "'c:\users\alok\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\Alok\\AppData\\Local\\Temp\\pip-install-5ojtpx8i\\cx-Freeze\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Alok\AppData\Local\Temp\pip-record-9oe_iyi5\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Alok\AppData\Local\Temp\pip-install-5ojtpx8i\cx-Freeze\
you don't have Microsoft Visual C++ 14.0 in your system. So first install this from official site - https://visualstudio.microsoft.com/downloads/
After that do below steps as -
pip install wheel
Then go to the following link to download the cx_Freeze wheel file according to you python version and windows version: https://www.lfd.uci.edu/~gohlke/pythonlibs/#cx_freeze
In your case what I can see versions as python - 3.7 and 32 bit windows system
For this you have to Download this .whl from above link -> cx_Freeze‑5.1.1‑cp37‑cp37m‑win32.whl
Then after download save that file to any folder and in command go to that folder do as -
pip install cx_Freeze‑5.1.1‑cp37‑cp37m‑win32.whl
I hope this will work for you.

Failed installing pycrypto with pip

I encountered a problem when I try to download a certain package:
C:\Python27\Scripts>pip install pycrypto
Collecting pycrypto
Using cached https://files.pythonhosted.org/packages/60/db/645aa9af249f059cc3a368b118de33889219e0362141e75d4eaf6f80f163/pycrypto-2.6.1.tar.gz
Installing collected packages: pycrypto
Running setup.py install for pycrypto ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools
, tokenize;__file__='c:\\users\\beheer~1\\appdata\\local\\temp\\pip-install-_luv
op\\pycrypto\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read(
).replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install
--record c:\users\beheer~1\appdata\local\temp\pip-record-jct20j\install-record.
txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-2.7
creating build\lib.win32-2.7\Crypto
copying lib\Crypto\pct_warnings.py -> build\lib.win32-2.7\Crypto
copying lib\Crypto\__init__.py -> build\lib.win32-2.7\Crypto
creating build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\hashalgo.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\HMAC.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\MD2.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\MD4.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\MD5.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\RIPEMD.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\SHA.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\SHA224.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\SHA256.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\SHA384.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\SHA512.py -> build\lib.win32-2.7\Crypto\Hash
copying lib\Crypto\Hash\__init__.py -> build\lib.win32-2.7\Crypto\Hash
creating build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\AES.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\ARC2.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\ARC4.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\blockalgo.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\Blowfish.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\CAST.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\DES.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\DES3.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\PKCS1_OAEP.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\PKCS1_v1_5.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\XOR.py -> build\lib.win32-2.7\Crypto\Cipher
copying lib\Crypto\Cipher\__init__.py -> build\lib.win32-2.7\Crypto\Cipher
creating build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\asn1.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\Counter.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\number.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\py21compat.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\py3compat.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\randpool.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\RFC1751.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\winrandom.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\_number_new.py -> build\lib.win32-2.7\Crypto\Util
copying lib\Crypto\Util\__init__.py -> build\lib.win32-2.7\Crypto\Util
creating build\lib.win32-2.7\Crypto\Random
copying lib\Crypto\Random\random.py -> build\lib.win32-2.7\Crypto\Random
copying lib\Crypto\Random\_UserFriendlyRNG.py -> build\lib.win32-2.7\Crypto\
Random
copying lib\Crypto\Random\__init__.py -> build\lib.win32-2.7\Crypto\Random
creating build\lib.win32-2.7\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\FortunaAccumulator.py -> build\lib.win32-2
.7\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\FortunaGenerator.py -> build\lib.win32-2.7
\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\SHAd256.py -> build\lib.win32-2.7\Crypto\R
andom\Fortuna
copying lib\Crypto\Random\Fortuna\__init__.py -> build\lib.win32-2.7\Crypto\
Random\Fortuna
creating build\lib.win32-2.7\Crypto\Random\OSRNG
copying lib\Crypto\Random\OSRNG\fallback.py -> build\lib.win32-2.7\Crypto\Ra
ndom\OSRNG
copying lib\Crypto\Random\OSRNG\nt.py -> build\lib.win32-2.7\Crypto\Random\O
SRNG
copying lib\Crypto\Random\OSRNG\posix.py -> build\lib.win32-2.7\Crypto\Rando
m\OSRNG
copying lib\Crypto\Random\OSRNG\rng_base.py -> build\lib.win32-2.7\Crypto\Ra
ndom\OSRNG
copying lib\Crypto\Random\OSRNG\__init__.py -> build\lib.win32-2.7\Crypto\Ra
ndom\OSRNG
creating build\lib.win32-2.7\Crypto\SelfTest
copying lib\Crypto\SelfTest\st_common.py -> build\lib.win32-2.7\Crypto\SelfT
est
copying lib\Crypto\SelfTest\__init__.py -> build\lib.win32-2.7\Crypto\SelfTe
st
creating build\lib.win32-2.7\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\common.py -> build\lib.win32-2.7\Crypto\S
elfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_AES.py -> build\lib.win32-2.7\Crypto
\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_ARC2.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_ARC4.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_Blowfish.py -> build\lib.win32-2.7\C
rypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_CAST.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_DES.py -> build\lib.win32-2.7\Crypto
\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_DES3.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_pkcs1_15.py -> build\lib.win32-2.7\C
rypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_pkcs1_oaep.py -> build\lib.win32-2.7
\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_XOR.py -> build\lib.win32-2.7\Crypto
\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\__init__.py -> build\lib.win32-2.7\Crypto
\SelfTest\Cipher
creating build\lib.win32-2.7\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\common.py -> build\lib.win32-2.7\Crypto\Sel
fTest\Hash
copying lib\Crypto\SelfTest\Hash\test_HMAC.py -> build\lib.win32-2.7\Crypto\
SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_MD2.py -> build\lib.win32-2.7\Crypto\S
elfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_MD4.py -> build\lib.win32-2.7\Crypto\S
elfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_MD5.py -> build\lib.win32-2.7\Crypto\S
elfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_RIPEMD.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA.py -> build\lib.win32-2.7\Crypto\S
elfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA224.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA256.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA384.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA512.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\__init__.py -> build\lib.win32-2.7\Crypto\S
elfTest\Hash
creating build\lib.win32-2.7\Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\test_AllOrNothing.py -> build\lib.win32
-2.7\Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\test_chaffing.py -> build\lib.win32-2.7
\Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\test_KDF.py -> build\lib.win32-2.7\Cryp
to\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\test_rfc1751.py -> build\lib.win32-2.7\
Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\__init__.py -> build\lib.win32-2.7\Cryp
to\SelfTest\Protocol
creating build\lib.win32-2.7\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_DSA.py -> build\lib.win32-2.7\Cry
pto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_ElGamal.py -> build\lib.win32-2.7
\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_importKey.py -> build\lib.win32-2
.7\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_RSA.py -> build\lib.win32-2.7\Cry
pto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\__init__.py -> build\lib.win32-2.7\Cry
pto\SelfTest\PublicKey
creating build\lib.win32-2.7\Crypto\SelfTest\Random
copying lib\Crypto\SelfTest\Random\test_random.py -> build\lib.win32-2.7\Cry
pto\SelfTest\Random
copying lib\Crypto\SelfTest\Random\test_rpoolcompat.py -> build\lib.win32-2.
7\Crypto\SelfTest\Random
copying lib\Crypto\SelfTest\Random\test__UserFriendlyRNG.py -> build\lib.win
32-2.7\Crypto\SelfTest\Random
copying lib\Crypto\SelfTest\Random\__init__.py -> build\lib.win32-2.7\Crypto
\SelfTest\Random
creating build\lib.win32-2.7\Crypto\SelfTest\Random\Fortuna
copying lib\Crypto\SelfTest\Random\Fortuna\test_FortunaAccumulator.py -> bui
ld\lib.win32-2.7\Crypto\SelfTest\Random\Fortuna
copying lib\Crypto\SelfTest\Random\Fortuna\test_FortunaGenerator.py -> build
\lib.win32-2.7\Crypto\SelfTest\Random\Fortuna
copying lib\Crypto\SelfTest\Random\Fortuna\test_SHAd256.py -> build\lib.win3
2-2.7\Crypto\SelfTest\Random\Fortuna
copying lib\Crypto\SelfTest\Random\Fortuna\__init__.py -> build\lib.win32-2.
7\Crypto\SelfTest\Random\Fortuna
creating build\lib.win32-2.7\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_fallback.py -> build\lib.win32
-2.7\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_generic.py -> build\lib.win32-
2.7\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_nt.py -> build\lib.win32-2.7\C
rypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_posix.py -> build\lib.win32-2.
7\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_winrandom.py -> build\lib.win3
2-2.7\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\__init__.py -> build\lib.win32-2.7\
Crypto\SelfTest\Random\OSRNG
creating build\lib.win32-2.7\Crypto\SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_asn1.py -> build\lib.win32-2.7\Crypto\
SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_Counter.py -> build\lib.win32-2.7\Cryp
to\SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_number.py -> build\lib.win32-2.7\Crypt
o\SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_winrandom.py -> build\lib.win32-2.7\Cr
ypto\SelfTest\Util
copying lib\Crypto\SelfTest\Util\__init__.py -> build\lib.win32-2.7\Crypto\S
elfTest\Util
creating build\lib.win32-2.7\Crypto\SelfTest\Signature
copying lib\Crypto\SelfTest\Signature\test_pkcs1_15.py -> build\lib.win32-2.
7\Crypto\SelfTest\Signature
copying lib\Crypto\SelfTest\Signature\test_pkcs1_pss.py -> build\lib.win32-2
.7\Crypto\SelfTest\Signature
copying lib\Crypto\SelfTest\Signature\__init__.py -> build\lib.win32-2.7\Cry
pto\SelfTest\Signature
creating build\lib.win32-2.7\Crypto\Protocol
copying lib\Crypto\Protocol\AllOrNothing.py -> build\lib.win32-2.7\Crypto\Pr
otocol
copying lib\Crypto\Protocol\Chaffing.py -> build\lib.win32-2.7\Crypto\Protoc
ol
copying lib\Crypto\Protocol\KDF.py -> build\lib.win32-2.7\Crypto\Protocol
copying lib\Crypto\Protocol\__init__.py -> build\lib.win32-2.7\Crypto\Protoc
ol
creating build\lib.win32-2.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\DSA.py -> build\lib.win32-2.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\ElGamal.py -> build\lib.win32-2.7\Crypto\Public
Key
copying lib\Crypto\PublicKey\pubkey.py -> build\lib.win32-2.7\Crypto\PublicK
ey
copying lib\Crypto\PublicKey\RSA.py -> build\lib.win32-2.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\_DSA.py -> build\lib.win32-2.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\_RSA.py -> build\lib.win32-2.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\_slowmath.py -> build\lib.win32-2.7\Crypto\Publ
icKey
copying lib\Crypto\PublicKey\__init__.py -> build\lib.win32-2.7\Crypto\Publi
cKey
creating build\lib.win32-2.7\Crypto\Signature
copying lib\Crypto\Signature\PKCS1_PSS.py -> build\lib.win32-2.7\Crypto\Sign
ature
copying lib\Crypto\Signature\PKCS1_v1_5.py -> build\lib.win32-2.7\Crypto\Sig
nature
copying lib\Crypto\Signature\__init__.py -> build\lib.win32-2.7\Crypto\Signa
ture
running build_ext
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastm
ath.
building 'Crypto.Random.OSRNG.winrandom' extension
error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpyt
hon27
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools,
tokenize;__file__='c:\
\users\\beheer~1\\appdata\\local\\temp\\pip-install-
_luvop\\pycrypto\\setup.py';
f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n', '\n');
f.close();exec(compile(code, __file__, 'exec'))" install --record
c:\users\behee
r~1\appdata\local\temp\pip-record-jct20j\install-record.txt --single-
version-ext
ernally-managed --compile" failed with error code 1 in
c:\users\beheer~1\appdata
\local\temp\pip-install-_luvop\pycrypto\
I already tried this command:
pip install --upgrade setuptools
And this still didnt work.
The solution was simple
just
pip uninstall pycrypto
pip install pycryptodome
And every should just work fine, it worked for me!
In some cases it is a dependency issue. It can be solved as follows:
for python2 run the following command:
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
For python3 run
sudo apt-get install build-essential libssl-dev libffi-dev python3-dev
I fixed same problem in linux running sudo apt-get install pythonX.X-dev before installing pycrypto. Replace pythonX.X with your python version e.g. sudo apt-get install python3.6-dev
After so many try with errors, now i have one solution for pycrypto and splunklib
Code of my Docker file that need to update :
FROM python:3.8-slim
RUN mkdir /app
WORKDIR /app
COPY requirements.txt /app
RUN pip install --no-cache-dir -r requirements.txt
RUN apt-get update && apt-get install -y --no-install-recommends gcc build-
essential postgresql libpq-dev vim
COPY . /app
WORKDIR /app/api
EXPOSE 3000
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "3000", "--reload"]
requirements.txt have
...
pycryptodome==3.14.1
splunk-sdk==1.6.19
splunklib==1.0.0
....
below error was showing for me when try to run above docker file code
Building wheel for splunk-sdk (setup.py): started
#9 80.50 Building wheel for splunk-sdk (setup.py): finished with status 'done'
#9 80.51 Created wheel for splunk-sdk: filename=splunk_sdk-1.6.20-py3-none-any.whl
size=124053 sha256=ddce3663bb166c6732e18f1ed95187528c2a666b996eff7dfac00302cf9771d7
#9 80.51 Stored in directory: /tmp/pip-ephem-wheel-cache-
frl315nd/wheels/f7/a1/72/b2474c8ffe6b02fe24078e3413ed668fe6b85dfb17cd8e64c2
#9 80.51 Building wheel for pycrypto (setup.py): started
#9 92.72 Building wheel for pycrypto (setup.py): finished with status 'error'
#9 92.76 error: subprocess-exited-with-error
Running setup.py install for pycrypto: started
#9 106.8 Running setup.py install for pycrypto: finished with status 'error'
#9 106.9 error: subprocess-exited-with-error note: This error originates from a subprocess, and is likely not a problem with pip.
#9 106.9 error: legacy-install-failure
#9 106.9 Encountered error while trying to install package.
#9 106.9 pycrypto
**Solution ** - Now i am updating docker file with below code
FROM python:3.8-slim
RUN mkdir /app
WORKDIR /app
COPY requirements.txt /app
RUN apt-get update && apt-get install -y --no-install-recommends gcc build-essential postgresql libpq-dev vim
RUN apt-get install -y --no-install-recommends libssl-dev libffi-dev
RUN pip install --no-cache-dir -r requirements.txt
COPY . /app
WORKDIR /app/api
EXPOSE 3000
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "3000", "--reload"]
installing python3-devel (for python3) helped to solve my problem
details in
fatal error: Python.h: No such file or directory
There is no support whatsoever from the project. Specifically in windows. Pycrypto Issue Link.
For ubuntu these answers will work.
But I guess for windows you should switch to pycryptodome as it installs the packages with the same crypto name as pycrypto,
Create new environment for python project for using command conda create -n env_name python=3.6
you to write python version according to your requirements. after that you can clone your project in that environment. it will work.

Issues with Python pandas: read_html and python3-lxml installation

I'm trying to run the following code, to no avail. To my knowledge, there aren't any syntax errors.
import quandl
import pandas as pd
fifty_states =pd.read_html('https://simple.wikipedia.org/wiki/List_of_U.S._states')
print(fifty_states)
I'm getting the following error when I run this code:
Traceback (most recent call last):
File "C:/Users/Dave/Documents/Python Files/helloworld.py", line 15, in
fiddy_states = pd.read_html('http://simple.wikipedia.org/wiki/List_of_U.S._states')
File "C:\Python35\lib\site-packages\pandas\io\html.py", line 874, in read_html
parse_dates, tupleize_cols, thousands, attrs, encoding)
File "C:\Python35\lib\site-packages\pandas\io\html.py", line 726, in _parse
parser = _parser_dispatch(flav)
File "C:\Python35\lib\site-packages\pandas\io\html.py", line 685, in _parser_dispatch
raise ImportError("lxml not found, please install it")
ImportError: lxml not found, please install it
Not too sure why this is occurring, as I (should) have all the packages required to run this code. I have problems installing lxml and python3-lxml, as the packages fail to install. As a backup, I've installed the following:
python-dev libxml2-dev libxslt1-dev zlib1g-dev
in addition to 'html5lib', which I've read is a suitable replacement to lxml.
Not sure what else to do at this point, since searching for similar corrections (i.e. installing lxml) don't apply to me (I can't install lxml in any format via pip on the command line).
Any help is much appreciated.
Edit: It appears that lxml was never installed on my computer. It's weird, because I'm unable to install it via pip install lxml. Here're the error logs I get when attempting an install:
Collecting lxml
Using cached lxml-3.6.4.tar.gz
Building wheels for collected packages: lxml
Running setup.py bdist_wheel for lxml ... error
Complete output from command c:\python35\python.exe -u -c "import setuptools,
tokenize;__file__='C:\\Users\\Dwang\\AppData\\Local\\Temp\\pip-build-738bf61u\\l
xml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().rep
lace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\Dwang\AppData\Lo
cal\Temp\tmpm9z4yol6pip-wheel- --python-tag cp35:
Building lxml version 3.6.4.
Building without Cython.
ERROR: b"'xslt-config' is not recognized as an internal or external command,\r
\noperable program or batch file.\r\n"
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\lxml
copying src\lxml\builder.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\cssselect.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\doctestcompare.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\ElementInclude.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\sax.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\usedoctest.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\_elementpath.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\__init__.py -> build\lib.win-amd64-3.5\lxml
creating build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win-amd64-3.5\lxml\includes
creating build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\builder.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\clean.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\defs.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\diff.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win-amd64-3.5\lxml\html
creating build\lib.win-amd64-3.5\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win-amd64-3.5\lxml\iso
schematron
copying src\lxml\lxml.etree.h -> build\lib.win-amd64-3.5\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-3.5\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-3.5\lxml\include
s
copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-3.5\lxml\incl
udes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-3.5\lxml\inclu
des
copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-3.5\lxml\inclu
des
copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-3.5\lxml\include
s
copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-3.5\lxml\include
s
copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-3.5\lxml\includ
es
copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-3.5\lxml\includ
es
copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-3.5\lxml\include
s
copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-3.5\lxml\inclu
des
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.w
in-amd64-3.5\lxml\isoschematron\resources\rng
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win-a
md64-3.5\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win-a
md64-3.5\lxml\isoschematron\resources\xsl
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schematr
on-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract
_expand.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-sche
matron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_inc
lude.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schemat
ron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematr
on_message.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-s
chematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematr
on_skeleton_for_xslt1.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resource
s\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for
_xslt1.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schem
atron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -
> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
error: Unable to find vcvarsall.bat
----------------------------------------
Failed building wheel for lxml
Running setup.py clean for lxml
Failed to build lxml
Installing collected packages: lxml
Running setup.py install for lxml ... error
Complete output from command c:\python35\python.exe -u -c "import setuptools
, tokenize;__file__='C:\\Users\\Dwang\\AppData\\Local\\Temp\\pip-build-738bf61u\
\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().r
eplace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Dwang\AppDat
a\Local\Temp\pip-4_tf2u3a-record\install-record.txt --single-version-externally-
managed --compile:
Building lxml version 3.6.4.
Building without Cython.
ERROR: b"'xslt-config' is not recognized as an internal or external command,
\r\noperable program or batch file.\r\n"
** make sure the development packages of libxml2 and libxslt are installed *
*
Using build configuration of libxslt
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\lxml
copying src\lxml\builder.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\cssselect.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\doctestcompare.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\ElementInclude.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\sax.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\usedoctest.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\_elementpath.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\__init__.py -> build\lib.win-amd64-3.5\lxml
creating build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win-amd64-3.5\lxml\includ
es
creating build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\builder.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\clean.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\defs.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\diff.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win-amd64-3.5\lxml\html
creating build\lib.win-amd64-3.5\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win-amd64-3.5\lxml\i
soschematron
copying src\lxml\lxml.etree.h -> build\lib.win-amd64-3.5\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-3.5\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win-amd64-3.5\lxml\include
s
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-3.5\lxml\inclu
des
copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-3.5\lxml\in
cludes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-3.5\lxml\inc
ludes
copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-3.5\lxml\includ
es
copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-3.5\lxml\inc
ludes
copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-3.5\lxml\inclu
des
copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-3.5\lxml\inclu
des
copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-3.5\lxml\incl
udes
copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-3.5\lxml\incl
udes
copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-3.5\lxml\inclu
des
copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-3.5\lxml\inc
ludes
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib
.win-amd64-3.5\lxml\isoschematron\resources\rng
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win
-amd64-3.5\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win
-amd64-3.5\lxml\isoschematron\resources\xsl
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schema
tron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstra
ct_expand.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-sc
hematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_i
nclude.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schem
atron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schema
tron_message.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso
-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schema
tron_skeleton_for_xslt1.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resour
ces\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_f
or_xslt1.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-sch
ematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt
-> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt
1
running build_ext
building 'lxml.etree' extension
error: Unable to find vcvarsall.bat
----------------------------------------
Command "c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\
\Users\\Dwang\\AppData\\Local\\Temp\\pip-build-738bf61u\\lxml\\setup.py';exec(co
mpile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __
file__, 'exec'))" install --record C:\Users\Dwang\AppData\Local\Temp\pip-4_tf2u3
a-record\install-record.txt --single-version-externally-managed --compile" faile
d with error code 1 in C:\Users\Dwang\AppData\Local\Temp\pip-build-738bf61u\lxml
\
From what I understand and according to the docs, if read_html() fails to use lxml, it should fall back to html5lib, but it looks ike it does not happen in your case and an error is thrown.
Try to explicitly state the flavor:
fifty_states = pd.read_html('https://simple.wikipedia.org/wiki/List_of_U.S._states', flavor='html5lib`)
Try
$ conda install -c conda-forge lxml
I had the same problem with the latest version (as of writing) of both pandas and lxml in my conda environment.
verified by:
conda list | findstr lxml
conda list | findstr pandas
(findstr is windows version of grep)
when I restarted the jupyterkernel after reinstalling the packages I could still not get pd.read_html() to work but strangely it would allow me to pass a string to be parsed instead of a url with no complaints. So i ran:
import subprocess
import pandas as pd
s = subprocess.check_output("curl https://www.myurl.com/page.html")
df = pd.read_html(io=s)
I have no idea why that would be any different from just allowing pandas to fetch the page but it worked so I figured I would share it here :)
I had the same problem and while the answers above, gave me clarity. It did not fix my problem. The reason my problem existed was because as of this writing, I was unable to install pandas via pip3 it would take a minimum of 30 minutes just to install so I had to find a more workable solution: Here are my steps that I took.
Panda install from the official pandas site vi apt-get (in my case on ubuntu) - https://pandas.pydata.org/pandas-docs/stable/getting_started/install.html sudo apt-get install python3-pandas
I used a virtualenv via a pip3 install virtualenv, activated the virtualenv: source ~/venv/bin/activate. However inside the virtualenv pandas, numpy, lxml, and html5lib. Could not be seen, my solution to fix this problem is in steps 3.
(MOST IMPORTANT PART) Create a symbolic link for each import you cannot see in your virtual venv. In my case I used the following commands for each of the packages.
ln -s /usr/lib/python3/dist-packages/pandas ~/venv/lib/python3.8/site-packages/
ln -s /usr/lib/python3/dist-packages/numpy ~/venv/lib/python3.8/site-packages/
ln -s /usr/lib/python3/dist-packages/lxml ~/venv/lib/python3.8/site-packages/
ln -s /usr/lib/python3/dist-packages/html5lib ~/venv/lib/python3.8/site-packages/
I hope this helps someone as much as it did me! :-)

Categories