Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot pip install version 1.0.x with latest (56.2.0+) version of setuptools #37

Closed
phillipuniverse opened this issue May 12, 2021 · 1 comment

Comments

@phillipuniverse
Copy link

phillipuniverse commented May 12, 2021

Simple example with a Dockerfile:

FROM python:3.6-buster
RUN pip install haversine==1.0.2

At time of writing this will install Python 3.6.13 and pip 21.1.1 (this hash on Docker Hub). When this is attempted, you get the following error:

#5 1.940   Downloading haversine-1.0.2.tar.gz (2.2 kB)
#5 2.313     ERROR: Command errored out with exit status 1:
#5 2.313      command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v4a64w95/haversine_e7df858ff483476cb0f5ea6864a61364/setup.py'"'"'; __file__='"'"'/tmp/pip-install-v4a64w95/haversine_e7df858ff483476cb0f5ea6864a61364/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'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-zhi880hu
#5 2.313          cwd: /tmp/pip-install-v4a64w95/haversine_e7df858ff483476cb0f5ea6864a61364/
#5 2.313     Complete output (26 lines):
#5 2.313     running egg_info
#5 2.313     creating /tmp/pip-pip-egg-info-zhi880hu/haversine.egg-info
#5 2.313     writing /tmp/pip-pip-egg-info-zhi880hu/haversine.egg-info/PKG-INFO
#5 2.313     Traceback (most recent call last):
#5 2.313       File "<string>", line 1, in <module>
#5 2.313       File "/tmp/pip-install-v4a64w95/haversine_e7df858ff483476cb0f5ea6864a61364/setup.py", line 29, in <module>
#5 2.313         'Topic :: Scientific/Engineering :: Mathematics'
#5 2.313       File "/usr/local/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
#5 2.313         return distutils.core.setup(**attrs)
#5 2.313       File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup
#5 2.313         dist.run_commands()
#5 2.313       File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commands
#5 2.313         self.run_command(cmd)
#5 2.313       File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
#5 2.313         cmd_obj.run()
#5 2.313       File "/usr/local/lib/python3.6/site-packages/setuptools/command/egg_info.py", line 292, in run
#5 2.313         writer(self, ep.name, os.path.join(self.egg_info, ep.name))
#5 2.313       File "/usr/local/lib/python3.6/site-packages/setuptools/command/egg_info.py", line 628, in write_pkg_info
#5 2.313         metadata.write_pkg_info(cmd.egg_info)
#5 2.313       File "/usr/local/lib/python3.6/distutils/dist.py", line 1106, in write_pkg_info
#5 2.313         self.write_pkg_file(pkg_info)
#5 2.313       File "/usr/local/lib/python3.6/site-packages/setuptools/dist.py", line 172, in write_pkg_file
#5 2.313         license = rfc822_escape(self.get_license())
#5 2.313       File "/usr/local/lib/python3.6/distutils/util.py", line 474, in rfc822_escape
#5 2.313         lines = header.split('\n')
#5 2.313     AttributeError: 'list' object has no attribute 'split'
#5 2.313     ----------------------------------------
#5 2.313 WARNING: Discarding https://files.pythonhosted.org/packages/92/1c/de387b6399070587970fe2007f8b1064d7f948cbb78c07fb61c65cbff560/haversine-1.0.2.tar.gz#sha256=63b9ceb3d2992314fe74948f57afd7d0fb623663ca32f2973565156aa34b9c52 (from https://pypi.org/simple/haversine/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
#5 2.314 ERROR: Could not find a version that satisfies the requirement haversine==1.0.2 (from versions: 0.1, 0.3, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.4.5, 0.5.0, 1.0.0, 1.0.1, 1.0.2, 2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.3.0)
#5 2.314 ERROR: No matching distribution found for haversine==1.0.2

This looks to be an unintended consequence of this change in setuptools in the 56.2.0 release notes

@phillipuniverse
Copy link
Author

The fix here is to upgrade to a 2.0+ version. The same example with 2.0.0 version works, as does the latest 2.3.0

FROM python:3.6-buster
RUN pip install haversine==2.0.0
FROM python:3.6-buster
RUN pip install haversine==2.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant