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

Pip upgrade issue #35

Open
daaray opened this issue Jan 8, 2015 · 3 comments
Open

Pip upgrade issue #35

daaray opened this issue Jan 8, 2015 · 3 comments
Labels

Comments

@daaray
Copy link

daaray commented Jan 8, 2015

On a newly provisioned 12.04 box with python 2.7, with or without this change that pins setuptools (5ffd6a7), the following error occurs on the initial fab vagrant deploy:

2015-01-08 00:47:25,527 [salt.loaded.int.module.cmdmod][ERROR   ] Command '/usr/bin/pip freeze' failed with return code: 2
2015-01-08 00:47:25,528 [salt.loaded.int.module.cmdmod][ERROR   ] stderr: Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
    self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/freeze.py", line 68, in run
    req = pip.FrozenRequirement.from_dist(dist, dependency_links, find_tags=find_tags)
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 156, in from_dist
    assert len(specs) == 1 and specs[0][0] == '=='AssertionError

ssh'ing into the box reveals:

daaray@precise32:/var/log/salt$ sudo pip --version
pip 1.0 from /usr/local/lib/python2.7/dist-packages (python 2.7)

I can work through this by manually upgrading pip at the command line and the do another deploy

daaray@precise32:/var/log/salt$ sudo pip install pip -U
...
daaray@precise32:/var/log/salt$ sudo pip --version
pip 6.0.6 from /usr/local/lib/python2.7/dist-packages (python 2.7)

I am uncertain as to why it is not upgrading itself without failing.

@daaray daaray added the bug label Jan 8, 2015
@mlavin
Copy link
Contributor

mlavin commented Jan 8, 2015

Digging through the Salt code the issue might be here: https://github.com/saltstack/salt/blob/v2014.7.0/salt/states/pip_state.py#L486
The states should currently upgrade setuptools then upgrade pip. Before calling pip install pip -U, it will run pip freeze. So we should have the most recent setuptools and pip 1.0 which is a potential source of conflict.

We should rethink how we bootstrap this system pip version. ensurepip is broken on Ubuntu/Debian (See https://bugs.launchpad.net/ubuntu/+source/python3.4/+bug/1290847). One possible solution would be:

  • Don't install python-pip from apt
  • Remove setuptools upgrade
  • Check if pip is installed

get-pip.py doesn't require setuptools to be installed before hand as of 1.5.1. I'm sure that future versions of pip will find some new and inventive way to break this workflow as well but it's worth a shot.

@vkurup
Copy link
Contributor

vkurup commented Aug 28, 2015

I'm not certain, but I think this can be closed now. I had seen this error in the past, but not on recent projects.

@yesimon
Copy link

yesimon commented Aug 28, 2015

Although I don't use margarita - I found this issue while googling. The default version of pip packaged on ubuntu 15.04 is still 1.5.6. https://launchpad.net/ubuntu/+source/python-pip. I still had to do something like this to get the a working pip.

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

No branches or pull requests

4 participants