I am getting
"Invalid requirement, parse error at "'-===x86-'"from the python2 setup.py install of LXML.
Not sure where to go next, can't find anything resembling "'-===x86-'" in requirements.txt or other files in my lxml-3.7.1/ source directory, and not sure what setuptools or other routines would automatically retrieve such a string.
My environment / system BASICS:
System - MSYS2 / MINGW64
LIBRARY_PATH=C:/msys64/usr/local/lib;
INCLUDE_PATH=C:/msys64/usr/local/include;
PATH=/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:
/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/\
WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:
/usr/bin/core_perl
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
CC=/mingw64/bin/x86_64-w64-mingw32-gcc (gcc version is 6.2.0-2)
CFLAGS=-I/usr/local/include -O3
msys/python2 2.7.11-1
Next I build / install LXML using the LIBXML2 I've already built previously:
$ python2 setup.py build_ext -i -I /usr/local/include/libxml2
Building lxml version 3.7.1.
Building without Cython.
Using build configuration of libxslt 1.1.29
Building against libxml2/libxslt in one of the following directories:
/usr/local/lib
C:/msys64/usr/local/lib
running build_ext
$ python2 setup.py install --record files.txt
Building lxml version 3.7.1.
Building without Cython.
Using build configuration of libxslt 1.1.29
Building against libxml2/libxslt in one of the following directories:
/usr/local/lib
C:/msys64/usr/local/lib
running install
....... <skipping lots of what I think are not relevant outputs....>
Processing 3)-x86_64.egg
creating /usr/lib/python2.7/site-packages/3)-x86_64.egg
Extracting 3)-x86_64.egg to /usr/lib/python2.7/site-packages
Adding 3- x86-64 to easy-install.pth file
Traceback (most recent call last):
File "setup.py", line 233, in <module>
**setup_extra_options()
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/usr/lib/python2.7/site-packages/setuptools/command/install.py", line 117, in do_egg_install
cmd.run()
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 391, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 621, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 672, in install_item
self.process_distribution(spec, dist, deps)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 697, in process_distribution
self.install_egg_scripts(dist)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 575, in install_egg_scripts
self.install_wrapper_scripts(dist)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 767, in install_wrapper_scripts
for args in ScriptWriter.best().get_args(dist):
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 2002, in get_args
spec = str(dist.as_requirement())
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2535, in as_requirement
return Requirement.parse(spec)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2818, in parse
req, = parse_requirements(s)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2762, in parse_requirements
req = packaging.requirements.Requirement(line)
File "/usr/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 94, in __init__
requirement_string[e.loc:e.loc + 8]))
pkg_resources._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'-===x86-'"
After this error, my site-packages does contain LXML in the following:
/msys64/usr/lib/python2.7/site-packages/3\)-x86_64.egg/lxml/
Simple attempts to use LXML fail:
$ python2
Python 2.7.11 (default, Mar 4 2016, 10:54:03)
[GCC 4.9.2] on msys
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> from lxml import etree
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "src/lxml/xmlschema.pxi", line 22, in init lxml.etree (src/lxml/lxml.etree.c:227959)
cdef XPath _check_for_default_attributes = XPath(
File "src/lxml/xpath.pxi", line 414, in lxml.etree.XPath.__init__ (src/lxml/lxml.etree.c:170395)
_XPathEvaluatorBase.__init__(self, namespaces, extensions,
File "src/lxml/xpath.pxi", line 133, in lxml.etree._XPathEvaluatorBase.__init__ (src/lxml/lxml.etree.c:166611)
self._context = _XPathContext(namespaces, extensions, self._error_log,
File "src/lxml/xpath.pxi", line 57, in lxml.etree._XPathContext.__init__ (src/lxml/lxml.etree.c:165567)
_BaseContext.__init__(self, namespaces, extensions, error_log, enable_regexp,
File "src/lxml/extensions.pxi", line 89, in lxml.etree._BaseContext.__init__ (src/lxml/lxml.etree.c:154495)
prefix_utf = self._to_utf(prefix)
File "src/lxml/extensions.pxi", line 128, in lxml.etree._BaseContext._to_utf (src/lxml/lxml.etree.c:155101)
utf = _utf8(s)
File "src/lxml/apihelpers.pxi", line 1443, in lxml.etree._utf8 (src/lxml/lxml.etree.c:31495)
raise ValueError(
ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters