Error when installing lxml with static dependencies

Bug #2067091 reported by Lucas Jenkins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
New
Undecided
Unassigned

Bug Description

Can't install lxml with static dependencies:

STATIC_DEPS=true pypy3 -m pip install lxml==4.8.0 -vvv

17.50 Collecting lxml==4.8.0
17.51 Created temporary directory: /tmp/pip-unpack-0pleyq6w
17.51 Looking up "https://files.pythonhosted.org/packages/3b/94/e2b1b3bad91d15526c7e38918795883cee18b93f6785ea8ecf13f8ffa01e/lxml-4.8.0.tar.gz" in the cache
17.51 No cache entry available
17.52 Starting new HTTPS connection (1): files.pythonhosted.org:443
20.89 https://files.pythonhosted.org:443 "GET /packages/3b/94/e2b1b3bad91d15526c7e38918795883cee18b93f6785ea8ecf13f8ffa01e/lxml-4.8.0.tar.gz HTTP/1.1" 200 3209187
20.90 Downloading lxml-4.8.0.tar.gz (3.2 MB)
21.65 Ignoring unknown cache-control directive: immutable
21.65 Updating cache with response from "https://files.pythonhosted.org/packages/3b/94/e2b1b3bad91d15526c7e38918795883cee18b93f6785ea8ecf13f8ffa01e/lxml-4.8.0.tar.gz"
21.65 etag object cached for 1209600 seconds
21.65 Caching due to etag
22.23 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 2.4 MB/s eta 0:00:00
23.40 Added lxml==4.8.0 from https://files.pythonhosted.org/packages/3b/94/e2b1b3bad91d15526c7e38918795883cee18b93f6785ea8ecf13f8ffa01e/lxml-4.8.0.tar.gz to build tracker '/tmp/pip-build-tracker-ijh6hlci'
23.41 Running setup.py (path:/tmp/pip-install-u640r3q2/lxml_3fd607effa1140c6b4507f4a71ea8494/setup.py) egg_info for package lxml
23.41 Created temporary directory: /tmp/pip-pip-egg-info-aez1e32l
23.42 Preparing metadata (setup.py): started
23.42 Running command python setup.py egg_info
89.54 Checking for gcc...
89.56 Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
89.56 ** ./configure aborting.
89.56 Building lxml version 4.8.0.
89.56 Latest version of zlib is 1.3.1
89.56 Downloading zlib into libs/zlib-1.3.1.tar.gz from https://zlib.net/zlib-1.3.1.tar.gz
89.56 Unpacking zlib-1.3.1.tar.gz into build/tmp
89.56 Latest version of libiconv is 1.17
89.56 Downloading libiconv into libs/libiconv-1.17.tar.gz from https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz
89.56 Unpacking libiconv-1.17.tar.gz into build/tmp
89.57 Latest version of libxml2 is 2.9.12
89.57 Downloading libxml2 into libs/libxml2-2.9.12.tar.gz from http://xmlsoft.org/sources/libxml2-2.9.12.tar.gz
89.57 Unpacking libxml2-2.9.12.tar.gz into build/tmp
89.57 Latest version of libxslt is 1.1.34
89.57 Downloading libxslt into libs/libxslt-1.1.34.tar.gz from http://xmlsoft.org/sources/libxslt-1.1.34.tar.gz
89.58 Unpacking libxslt-1.1.34.tar.gz into build/tmp
89.58 Starting build in build/tmp/zlib-1.3.1
89.58 Traceback (most recent call last):
89.58 File "<string>", line 2, in <module>
89.58 File "<pip-setuptools-caller>", line 34, in <module>
89.58 File "/tmp/pip-install-u640r3q2/lxml_3fd607effa1140c6b4507f4a71ea8494/setup.py", line 270, in <module>
89.58 **setup_extra_options()
89.59 ^^^^^^^^^^^^^^^^^^^^^
89.59 File "/tmp/pip-install-u640r3q2/lxml_3fd607effa1140c6b4507f4a71ea8494/setup.py", line 162, in setup_extra_options
89.59 ext_modules = setupinfo.ext_modules(
89.59 File "/tmp/pip-install-u640r3q2/lxml_3fd607effa1140c6b4507f4a71ea8494/setupinfo.py", line 74, in ext_modules
89.59 XML2_CONFIG, XSLT_CONFIG = build_libxml2xslt(
89.59 File "/tmp/pip-install-u640r3q2/lxml_3fd607effa1140c6b4507f4a71ea8494/buildlibxml.py", line 428, in build_libxml2xslt
89.59 cmmi(zlib_configure_cmd, zlib_dir, multicore, **call_setup)
89.59 File "/tmp/pip-install-u640r3q2/lxml_3fd607effa1140c6b4507f4a71ea8494/buildlibxml.py", line 345, in cmmi
89.59 call_subprocess(configure_cmd, cwd=build_dir, **call_setup)
89.59 File "/tmp/pip-install-u640r3q2/lxml_3fd607effa1140c6b4507f4a71ea8494/buildlibxml.py", line 335, in call_subprocess
89.59 raise Exception('Command "%s" returned code %s' % (cmd_desc, returncode))
89.59 Exception: Command "./configure --prefix=/tmp/pip-install-u640r3q2/lxml_3fd607effa1140c6b4507f4a71ea8494/build/tmp/libxml2" returned code 1
89.61 error: subprocess-exited-with-error
89.61
89.61 × python setup.py egg_info did not run successfully.
89.61 │ exit code: 1
89.61 ╰─> See above for output.
89.61
89.61 note: This error originates from a subprocess, and is likely not a problem with pip.
89.62 full command: /opt/pypy/bin/pypy3 -c '
89.62 exec(compile('"'"''"'"''"'"'
89.62 # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
89.62 #
89.62 # - It imports setuptools before invoking setup.py, to enable projects that directly
89.62 # import from `distutils.core` to work with newer packaging standards.
89.62 # - It provides a clear error message when setuptools is not installed.
89.62 # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
89.62 # setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
89.62 # manifest_maker: standard file '"'"'-c'"'"' not found".
89.62 # - It generates a shim setup.py, for handling setup.cfg-only projects.
89.62 import os, sys, tokenize
89.62
89.62 try:
89.62 import setuptools
89.62 except ImportError as error:
89.62 print(
89.62 "ERROR: Can not execute `setup.py` since setuptools is not available in "
89.62 "the build environment.",
89.62 file=sys.stderr,
89.62 )
89.62 sys.exit(1)
89.62
89.62 __file__ = %r
89.62 sys.argv[0] = __file__
89.62
89.62 if os.path.exists(__file__):
89.62 filename = __file__
89.62 with tokenize.open(__file__) as f:
89.62 setup_py_code = f.read()
89.62 else:
89.62 filename = "<auto-generated setuptools caller>"
89.62 setup_py_code = "from setuptools import setup; setup()"
89.62
89.62 exec(compile(setup_py_code, filename, "exec"))
89.62 '"'"''"'"''"'"' % ('"'"'/tmp/pip-install-u640r3q2/lxml_3fd607effa1140c6b4507f4a71ea8494/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' egg_info --egg-base /tmp/pip-pip-egg-info-aez1e32l
89.62 cwd: /tmp/pip-install-u640r3q2/lxml_3fd607effa1140c6b4507f4a71ea8494/
89.62 Preparing metadata (setup.py): finished with status 'error'
89.63 error: metadata-generation-failed
89.63
89.63 × Encountered error while generating package metadata.
89.63 ╰─> See above for output.
89.63
89.63 note: This is an issue with the package mentioned above, not pip.
89.63 hint: See above for details.
89.64 Exception information:
89.64 Traceback (most recent call last):
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/operations/build/metadata_legacy.py", line 64, in generate_metadata
89.64 call_subprocess(
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/utils/subprocess.py", line 224, in call_subprocess
89.64 raise error
89.64 pip._internal.exceptions.InstallationSubprocessError: python setup.py egg_info exited with 1
89.64
89.64 The above exception was the direct cause of the following exception:
89.64
89.64 Traceback (most recent call last):
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/cli/base_command.py", line 160, in exc_logging_wrapper
89.64 status = run_func(*args)
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/cli/req_command.py", line 247, in wrapper
89.64 return func(self, options, args)
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/commands/install.py", line 419, in run
89.64 requirement_set = resolver.resolve(
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve
89.64 result = self._result = resolver.resolve(
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 481, in resolve
89.64 state = resolution.resolve(requirements, max_rounds=max_rounds)
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 348, in resolve
89.64 self._add_to_criteria(self.state.criteria, r, parent=None)
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 172, in _add_to_criteria
89.64 if not criterion.candidates:
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_vendor/resolvelib/structs.py", line 151, in __bool__
89.64 return bool(self._sequence)
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in __bool__
89.64 return any(self)
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in <genexpr>
89.64 return (c for c in iterator if id(c) not in self._incompatible_ids)
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 47, in _iter_built
89.64 candidate = func()
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 206, in _make_candidate_from_link
89.64 self._link_candidate_cache[link] = LinkCandidate(
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 297, in __init__
89.64 super().__init__(
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 162, in __init__
89.64 self.dist = self._prepare()
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 231, in _prepare
89.64 dist = self._prepare_distribution()
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 308, in _prepare_distribution
89.64 return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/operations/prepare.py", line 491, in prepare_linked_requirement
89.64 return self._prepare_linked_requirement(req, parallel_builds)
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/operations/prepare.py", line 577, in _prepare_linked_requirement
89.64 dist = _get_prepared_distribution(
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/operations/prepare.py", line 69, in _get_prepared_distribution
89.64 abstract_dist.prepare_distribution_metadata(
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/distributions/sdist.py", line 61, in prepare_distribution_metadata
89.64 self.req.prepare_metadata()
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/req/req_install.py", line 545, in prepare_metadata
89.64 self.metadata_directory = generate_metadata_legacy(
89.64 File "/opt/pypy/lib/pypy3.10/site-packages/pip/_internal/operations/build/metadata_legacy.py", line 71, in generate_metadata
89.64 raise MetadataGenerationFailed(package_details=details) from error
89.64 pip._internal.exceptions.MetadataGenerationFailed: metadata generation failed

Also, someone else had the same problem 4 years ago:
https://stackoverflow.com/questions/56825101/installing-lxml-with-static-dependencies

Version:
- pypy 3.10-v7.3.16 (I need pypy3.10 instead of python)
- lxml 4.8.0

description: updated
description: updated
Revision history for this message
scoder (scoder) wrote :

There's no clear error message but it looks like there's something wrong or incomplete in your build environment. "configure" failed, so your machine is not able to compile binary code or something like that. See https://lxml.de/installation.html#requirements

Revision history for this message
Lucas Jenkins (ljenkins1) wrote :

You were right, it fixed the problem. Thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.