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

Closed
sharov opened this Issue Nov 13, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@sharov
Contributor

sharov commented Nov 13, 2018

Upgrade pip and setuptools to latest versions

oleg$ pip install --upgrade pip setuptools
Collecting pip
  Using cached https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl
Collecting setuptools
  Using cached https://files.pythonhosted.org/packages/4b/47/1417da90ed6f4c88465d08ea2461ff41c94cc6cc223f333d130d7a99199a/setuptools-40.6.1-py2.py3-none-any.whl
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
  Downloading https://files.pythonhosted.org/packages/dc/bd/eac45e4e77d76f6c0ae539819c40f1babb891d7855129663e37957a7c2df/d2to1-0.2.12.post1.tar.gz
    Complete output from command python setup.py 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/setup.py", line 17, in <module>
        setup(**cfg_to_args())
      File "d2to1/util.py", line 204, in cfg_to_args
        wrap_commands(kwargs)
      File "d2to1/util.py", line 439, in wrap_commands
        for cmd, _ in dist.get_command_list():
      File "/Users/oleg/.virtualenvs/yandex/lib/python2.7/site-packages/setuptools/dist.py", line 724, in get_command_list
        cmdclass = ep.resolve()
      File "/Users/oleg/.virtualenvs/yandex/lib/python2.7/site-packages/pkg_resources/__init__.py", 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/upload_docs.py", line 23, in <module>
        from .upload import upload
      File "/Users/oleg/.virtualenvs/yandex/lib/python2.7/site-packages/setuptools/command/upload.py", line 15, in <module>
        from six.moves.urllib.request import urlopen, Request
    ImportError: No module named six.moves.urllib.request
    
    ----------------------------------------
Command "python setup.py 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 https://files.pythonhosted.org/packages/82/a1/ba6fb41367b375f5cb653d1317d8ca263c636cff6566e2da1b0da716069d/setuptools-40.5.0-py2.py3-none-any.whl (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 https://files.pythonhosted.org/packages/dc/bd/eac45e4e77d76f6c0ae539819c40f1babb891d7855129663e37957a7c2df/d2to1-0.2.12.post1.tar.gz
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 setup.py 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

@sharov sharov referenced this issue Nov 13, 2018

Merged

Import internal version of six #1591

0 of 2 tasks complete
@pganssle

This comment has been minimized.

Member

pganssle commented Nov 13, 2018

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.

@niekas

This comment has been minimized.

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.

@benoit-pierre

This comment has been minimized.

Member

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 setup.py). Also note that the upload command is deprecated: you should switch to using twine upload anyway.

@pganssle

This comment has been minimized.

Member

pganssle commented Nov 16, 2018

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

I pulled up a devpi server and setup.py 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