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

Impossible to install packages with setuptools v.40.6.x, if six isn't installed #1592

sharov opened this issue Nov 13, 2018 · 4 comments


Copy link

sharov commented Nov 13, 2018

Upgrade pip and setuptools to latest versions

oleg$ pip install --upgrade pip setuptools
Collecting pip
  Using cached
Collecting setuptools
  Using cached
Installing collected packages: pip, setuptools
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
  Found existing installation: setuptools 38.2.4
    Uninstalling setuptools-38.2.4:
      Successfully uninstalled setuptools-38.2.4
Successfully installed pip-18.1 setuptools-40.6.1

Try to install any package, d2to1 for example

oleg$ pip install d2to1
Collecting d2to1
    Complete output from command python egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/ns/71p61z5s3hsd2pv327gmdh1c0000gn/T/pip-install-2J_LhF/d2to1/", line 17, in <module>
      File "d2to1/", line 204, in cfg_to_args
      File "d2to1/", line 439, in wrap_commands
        for cmd, _ in dist.get_command_list():
      File "/Users/oleg/.virtualenvs/yandex/lib/python2.7/site-packages/setuptools/", line 724, in get_command_list
        cmdclass = ep.resolve()
      File "/Users/oleg/.virtualenvs/yandex/lib/python2.7/site-packages/pkg_resources/", line 2352, in resolve
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
      File "/Users/oleg/.virtualenvs/yandex/lib/python2.7/site-packages/setuptools/command/", line 23, in <module>
        from .upload import upload
      File "/Users/oleg/.virtualenvs/yandex/lib/python2.7/site-packages/setuptools/command/", line 15, in <module>
        from six.moves.urllib.request import urlopen, Request
    ImportError: No module named six.moves.urllib.request
Command "python egg_info" failed with error code 1 in /private/var/folders/ns/71p61z5s3hsd2pv327gmdh1c0000gn/T/pip-install-2J_LhF/d2to1/
oleg$ pip list
Package    Version     
---------- ------------
d2to1      0.2.12.post1
pip        18.1        
setuptools 40.6.1      
wheel      0.30.0

Downgrade setuptools to v.40.5.0, and try installation again

oleg$ pip install --upgrade setuptools==40.5.0
Collecting setuptools==40.5.0
  Downloading (569kB)
    100% |████████████████████████████████| 573kB 754kB/s 
Installing collected packages: setuptools
  Found existing installation: setuptools 40.6.1
    Uninstalling setuptools-40.6.1:
      Successfully uninstalled setuptools-40.6.1
Successfully installed setuptools-40.5.0

oleg$ pip install d2to1
Collecting d2to1
  Using cached
Requirement already satisfied: setuptools in /Users/oleg/.virtualenvs/yandex/lib/python2.7/site-packages (from d2to1) (40.5.0)
Building wheels for collected packages: d2to1
  Running bdist_wheel for d2to1 ... done
  Stored in directory: /Users/oleg/Library/Caches/pip/wheels/e6/1a/ed/11531583d510d72448e39bfc254147d0e7b2b2ad65722b3a6f
Successfully built d2to1
Installing collected packages: d2to1
Successfully installed d2to1-0.2.12.post1
Copy link

Interesting that this occurs when doing things other than uploading, since the bug is in the upload command. I suppose it makes sense that all those commands need to be imported to register them.

Copy link

niekas commented Nov 15, 2018

When I execute upload command using setuptools v.40.6.x and the extras_require section of setup() is not empty, the server response is 400 Bad request. If I downgrade the version to setuptools v.40.5.0 or remove extras_require section - server response is 200. Not sure if this is the same issue, but looks similar.

Copy link

benoit-pierre commented Nov 15, 2018

@niekas: It's not the same. Please create a new issue with all the relevant information (ideally a reproducible example Also note that the upload command is deprecated: you should switch to using twine upload anyway.

Copy link

If @niekas or anyone else can reproduce this, do please make a separate issue, though as Benoit mentions, you should not be using upload anyway.

I pulled up a devpi server and upload worked just fine with extras_require. Possibly the public PyPI behaves differently, but I don't see why it would.

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

No branches or pull requests

4 participants