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

Error when upgrading to 10.0.1 via pip #320

Closed
ghost opened this issue Dec 30, 2014 · 15 comments
Closed

Error when upgrading to 10.0.1 via pip #320

ghost opened this issue Dec 30, 2014 · 15 comments

Comments

@ghost
Copy link

ghost commented Dec 30, 2014

Originally reported by: spulec (Bitbucket: spulec, GitHub: spulec)


I'm having trouble upgrading to the newest version.

Downloading/unpacking setuptools==10.0.1
  Downloading setuptools-10.0.1.tar.gz (626kB): 626kB downloaded
  Running setup.py egg_info for package setuptools

    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "../venv/build/setuptools/setup.py", line 210, in <module>
        dist = setuptools.setup(**setup_params)
      File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
        dist.run_commands()
      File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "<string>", line 14, in replacement_run
      File "setuptools/command/egg_info.py", line 206, in find_sources
        mm.run()
      File "setuptools/command/egg_info.py", line 290, in run
        self.add_defaults()
      File "setuptools/command/egg_info.py", line 322, in add_defaults
        rcfiles = list(walk_revctrl())
      File "setuptools/command/sdist.py", line 18, in walk_revctrl
        for item in ep.load()(dirname):
      File "pkg_resources/__init__.py", line 2265, in load
        raise ImportError("%r has no %r attribute" % (entry, attr))
    ImportError: <module 'setuptools.command.sdist' from 'setuptools/command/sdist.py'> has no '_default_revctrl' attribute
    Complete output from command python setup.py egg_info:
    running egg_info

Ubuntu 12.04
pip 1.4


@ghost
Copy link
Author

ghost commented Dec 30, 2014

Original comment by tawm04 (Bitbucket: tawm04, GitHub: Unknown):


I'm having the same issues. Ubuntu 12.04. I forced it to version 9.1 and it worked.

#!bash
root@vagrant-ubuntu-precise-64:~# pip install setuptools --no-use-wheel --upgrade
...
    ImportError: <module 'setuptools.command.sdist' from 'setuptools/command/sdist.py'> has no '_default_revctrl' attribute
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-KB_PAp/setuptools
root@vagrant-ubuntu-precise-64:~# pip install setuptools==9.1 --no-use-wheel
Collecting setuptools==9.1
  Downloading setuptools-9.1.tar.gz (808kB)
    100% |################################| 811kB 9.0MB/s 
Installing collected packages: setuptools
  Found existing installation: setuptools 0.6rc11
    Can't uninstall 'setuptools'. No files were found to uninstall.
  Running setup.py install for setuptools
    Installing easy_install script to /usr/local/bin
    Installing easy_install-2.7 script to /usr/local/bin
Successfully installed setuptools-9.1
root@vagrant-ubuntu-precise-64:~# pip --version
pip 6.0.3 from /usr/local/lib/python2.7/dist-packages/pip-6.0.3-py2.7.egg (python 2.7)

@ghost
Copy link
Author

ghost commented Dec 30, 2014

Original comment by kevinastone (Bitbucket: kevinastone, GitHub: kevinastone):


Affected us too on 12.04. Only workaround I could find was to go back to easy_install

easy_install --upgrade setuptools

@ghost
Copy link
Author

ghost commented Dec 31, 2014

Original comment by cognifloyd (Bitbucket: cognifloyd, GitHub: cognifloyd):


This broke my vagrant boxes which I was destroying/rebuilding. If I try to install pyyaml (amongst other packages) with setuptools-10.0.1, I get the same error as others here.

@ghost
Copy link
Author

ghost commented Dec 31, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


@cognifloyd Are you saying you get an ImportError about _default_revctrl when attempting to install pyyaml? With pip or setuptools? That error sounds different than what the OP has filed, which is about upgrading setuptools. Can you clarify that the issue appears the same or maybe file a separate ticket describing your experience in more detail?

@ghost
Copy link
Author

ghost commented Dec 31, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


My initial reaction is this issue is probably a pip issue, but I'm happy to field it here. Setuptools could simply provide that method to satisfy the conditions under upgrade. However, I believe it's prudent to understand the cause of the issue to avoid it happening in the future (and to allow for adding new metadata to setuptools as is planned as well).

@ghost
Copy link
Author

ghost commented Dec 31, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Reports in IRC indicate that the issue occurs when upgrading from 9.1 to 10.0.1, but I'm unable to replicate:

vagrant@precise64:~$ wget https://bootstrap.pypa.io/get-pip.py -O - | sudo python -
--2014-12-31 04:10:25--  https://bootstrap.pypa.io/get-pip.py
Resolving bootstrap.pypa.io (bootstrap.pypa.io)... 23.235.46.175
Connecting to bootstrap.pypa.io (bootstrap.pypa.io)|23.235.46.175|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1581355 (1.5M) [text/x-python]
Saving to: `STDOUT'

100%[=======================================================================>] 1,581,355   2.98M/s   in 0.5s

2014-12-31 04:10:26 (2.98 MB/s) - written to stdout [1581355/1581355]

Collecting pip
  Downloading pip-6.0.3-py2.py3-none-any.whl (1.3MB)
    100% |################################| 1.3MB 5.5MB/s
Collecting setuptools
  Downloading setuptools-10.0.1-py2.py3-none-any.whl (496kB)
    100% |################################| 499kB 4.7MB/s
Installing collected packages: setuptools, pip


Successfully installed pip-6.0.3 setuptools-10.0.1
vagrant@precise64:~$ sudo pip install setuptools==9.1
Collecting setuptools==9.1
  Downloading setuptools-9.1-py2.py3-none-any.whl (552kB)
    100% |################################| 552kB 2.9MB/s
Installing collected packages: setuptools
  Found existing installation: setuptools 10.0.1
    Uninstalling setuptools-10.0.1:
      Successfully uninstalled setuptools-10.0.1

Successfully installed setuptools-9.1
vagrant@precise64:~$ sudo pip install setuptools --upgrade --no-use-wheel
Collecting setuptools from https://pypi.python.org/packages/source/s/setuptools/setuptools-10.0.1.tar.gz#md5=abaf3b5d654eb525b9ca67c6d4522292
  Downloading setuptools-10.0.1.tar.gz (626kB)
    100% |################################| 626kB 2.0MB/s
Installing collected packages: setuptools
  Found existing installation: setuptools 9.1
    Uninstalling setuptools-9.1:
      Successfully uninstalled setuptools-9.1
  Running setup.py install for setuptools
    Installing easy_install script to /usr/local/bin
    Installing easy_install-2.7 script to /usr/local/bin
Successfully installed setuptools-10.0.1

@ghost
Copy link
Author

ghost commented Dec 31, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


I was able to replicate the issue by using apt to install python-pip and then trying to upgrade setuptools (which upgrades distribute, which installs setuptools>0.7, grabbing 10.0.1).

I was also able to trigger the failure thus:

sudo aptitude install python-pip
sudo pip install pip --upgrade
sudo pip install setuptools==9.1
sudo pip install setuptools --upgrade --no-use-wheel

In that environment, I've downloaded 10.0.1, and indeed I can see that the file finders from the other environment are being discovered:

vagrant@precise64:~/tmp/setuptools-10.0.1$ python -c "import pkg_resources; print(list(pkg_resources.iter_entry_points('setuptools.file_finders')))"
[EntryPoint.parse('svn_cvs = setuptools.command.sdist:_default_revctrl')]

@ghost
Copy link
Author

ghost commented Dec 31, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Investigating further, I find that the reason that file finder is being discovered is not due to the installation of setuptools 9.1, but is due to the installation of distribute-0.6.24dev_r0, a remnant of the installation of system package python-pip. Removing the system-managed packages corrects the issue:

sudo aptitude remove python-pip

Now the entry point isn't present:

vagrant@precise64:~/tmp/setuptools-10.0.1$ python -c "import pkg_resources; print(list(pkg_resources.iter_entry_points('setuptools.file_finders')))"
[]

And upgrade from 9.1 to 10.0.1 works without fail.

I believe the issue here is an Ubuntu one and that the solution is to stick with the old system-managed packages or remove them and use the tool-managed packages.

@ghost
Copy link
Author

ghost commented Dec 31, 2014

Original comment by reinout (Bitbucket: reinout, GitHub: reinout):


I'm having a similar issue when bootstrapping buildout on an ubuntu 12.04 LTS box. The same "_default_revctrl" error.

Having setuptools (or rather distribute) installed as a system package isn't uncommon. And 12.04 LTS is quite widely used. So is it really an option to tell all of them to modify their system? Isn't a backwards compatibility function/atribute/whatever (that doesn't do anything) better?

I don't quite look forward to mailing my colleagues "you need to update your 12.04 systems' setuptools to the latest version to work around a change in that very same latest version. Oh, and also do that on all the 12.04 servers"... :-)

@ghost
Copy link
Author

ghost commented Dec 31, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


@reinout You're right. I came to the same conclusion after thinking about it a bit more. I also realized that the issue isn't as broad as I had originally thought. It should only affect entry points and not metadata in general.

However, I do find it troubling that Debian will leave installed a package that imposes constraints on another user-installed package. I recognize that's difficult to manage with inversion-of-control as entry points exposes.

Thankfully, the issue seems not to affect Trusty.

@ghost
Copy link
Author

ghost commented Dec 31, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Restore _default_revctrl implementation (stubbed). Fixes #320.

@ghost
Copy link
Author

ghost commented Dec 31, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Add test capturing requirement. Ref #320.

@ghost
Copy link
Author

ghost commented Dec 31, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Fix released as 10.1.

@ghost
Copy link
Author

ghost commented Dec 31, 2014

Original comment by spulec (Bitbucket: spulec, GitHub: spulec):


Fix works for me. Thank you!

@ghost
Copy link
Author

ghost commented Dec 31, 2014

Original comment by kevinastone (Bitbucket: kevinastone, GitHub: kevinastone):


Same, thanks!

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

No branches or pull requests

0 participants