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

urllib3 fails to install on centos7 due to old setuptools not supporting <=, < environment markers. #986

Closed
rene00 opened this issue Sep 27, 2016 · 3 comments

Comments

@rene00
Copy link

rene00 commented Sep 27, 2016

Current urllib3 fails to install on centos7. This bug was most likely introduced after 9f5454e.

centos7 ships a very old version of setuptools (0.9.8) which does not support <= as an environment marker. See pypa/setuptools#380.

$ python --version
Python 2.7.5

$ rpm -qa python-setuptools
python-setuptools-0.9.8-4.el7.noarch

$ lsb_release -a
...
Description:    CentOS Linux release 7.2.1511 (Core) 
Release:    7.2.1511

$ virtualenv venv
...

$ venv/bin/pip install urllib3
Downloading/unpacking urllib3
  Downloading urllib3-1.18.tar.gz (183kB): 183kB downloaded
  Running setup.py egg_info for package urllib3
    error in urllib3 setup command: Invalid environment marker: python_version <= "2.7"
    Complete output from command python setup.py egg_info:
    error in urllib3 setup command: Invalid environment marker: python_version <= "2.7"

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/rene/src/venv/build/urllib3
Storing complete log in /home/rene/.pip/pip.log

Installing f620d99 (commit before 9f5454e) works fine.

$ venv/bin/pip install git+git://github.com/shazow/urllib3.git@f620d997134708b09560ca5797aa79a59a2ef4c0
...
Successfully installed urllib3
Cleaning up...

But 9f5454e fails.

$ venv/bin/pip install git+git://github.com/shazow/urllib3.git@9f5454eac808a105307b2d363c99ce97e5109821
Downloading/unpacking git+git://github.com/shazow/urllib3.git@9f5454eac808a105307b2d363c99ce97e5109821
  Cloning git://github.com/shazow/urllib3.git (to 9f5454eac808a105307b2d363c99ce97e5109821) to /tmp/pip-lnVDAG-build
  Could not find a tag or branch '9f5454eac808a105307b2d363c99ce97e5109821', assuming commit.
  Running setup.py egg_info for package from git+git://github.com/shazow/urllib3.git@9f5454eac808a105307b2d363c99ce97e5109821
    error in urllib3 setup command: Invalid environment marker: python_version < "3.3"
    Complete output from command python setup.py egg_info:
    error in urllib3 setup command: Invalid environment marker: python_version < "3.3"

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-lnVDAG-build
Storing complete log in /home/rene/.pip/pip.log

urllib3 1.17 setup.py does not ship with < or <= markers so my workaround right now is to install urllib3==1.17.

@rene00 rene00 changed the title urllib3 fails to install on centos7 due old setuptools not support <=, < environment markers in setup.py urllib3 fails to install on centos7 due to old setuptools not supporting <=, < environment markers. Sep 27, 2016
@Lukasa
Copy link
Sponsor Contributor

Lukasa commented Sep 27, 2016

Given that you're in a virtual environment, I recommend you work around this issue by running venv/bin/pip install -U setuptools, which should resolve the issue and allow you to use the newest urllib3.

@Lukasa
Copy link
Sponsor Contributor

Lukasa commented Sep 27, 2016

Oh, I see, I didn't realise that your version of setuptools didn't support markers at all. That explains a lot. Regardless, the best solution is to update setuptools in your virtualenv and continue: that's generally a good policy.

@Lukasa
Copy link
Sponsor Contributor

Lukasa commented Sep 27, 2016

In the medium term, we should remove the markers from setup.py and just leave them in setup.cfg.

Lukasa added a commit to Lukasa/urllib3 that referenced this issue Sep 27, 2016
opennode-jenkins pushed a commit to opennode/waldur-core that referenced this issue Sep 27, 2016
Don't use urllib3 1.18 because it's not compatible with old setuptools.

See also: urllib3/urllib3#986

See merge request !1468
richardwhiuk added a commit to Metaswitch/clearwater-etcd that referenced this issue Oct 28, 2016
python-etcd requires urllib3 > 1.7. If we pull urllib3 1.18.1, the build fails
due to urllib3/urllib3#986.

To avoid this, and future issues, pin urlib3 1.17 which is known to work.
Dobatymo pushed a commit to Dobatymo/urllib3 that referenced this issue Mar 16, 2022
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

2 participants