Question

I build a development environment using vagrant and virtualenv/virtualenvwrapper. Recently, my vagrant box stopped provisioning correctly. It seems virtualenvwrapper won't install anymore. I am trying to trace down what has changed. What has changed?

My Vagrantfile and install.sh files are here: https://gist.github.com/ErikEvenson/9763878. Note that this error happens on the web box.

This is the error I get when I try to install virtualenvwrapper:

vagrant@vagrant-ubuntu-precise-64:~$ pip install virtualenvwrapper
Downloading/unpacking virtualenvwrapper
  Downloading virtualenvwrapper-4.2.tar.gz (125Kb): 125Kb downloaded
  Running setup.py egg_info for package virtualenvwrapper

    Installed /home/vagrant/build/virtualenvwrapper/pbr-0.7.0-py2.7.egg
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
      File "/home/vagrant/build/virtualenvwrapper/setup.py", line 7, in <module>
        pbr=True,
      File "/usr/lib/python2.7/distutils/core.py", line 112, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 221, in __init__
        self.fetch_build_eggs(attrs.pop('setup_requires'))
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 245, in fetch_build_eggs
        parse_requirements(requires), installer=self.fetch_build_egg
      File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 588, in resolve
        raise VersionConflict(dist,req) # XXX put more info here
    pkg_resources.VersionConflict: (pip 1.0 (/usr/lib/python2.7/dist-packages), Requirement.parse('pip>=1.4'))
    Complete output from command python setup.py egg_info:


Installed /home/vagrant/build/virtualenvwrapper/pbr-0.7.0-py2.7.egg

Traceback (most recent call last):

  File "<string>", line 14, in <module>

  File "/home/vagrant/build/virtualenvwrapper/setup.py", line 7, in <module>

    pbr=True,

  File "/usr/lib/python2.7/distutils/core.py", line 112, in setup

    _setup_distribution = dist = klass(attrs)

  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 221, in __init__

    self.fetch_build_eggs(attrs.pop('setup_requires'))

  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 245, in fetch_build_eggs

    parse_requirements(requires), installer=self.fetch_build_egg

  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 588, in resolve

    raise VersionConflict(dist,req) # XXX put more info here

pkg_resources.VersionConflict: (pip 1.0 (/usr/lib/python2.7/dist-packages), Requirement.parse('pip>=1.4'))

----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /home/vagrant/.pip/pip.log
Was it helpful?

Solution 2

Running pip install --upgrade pip after doing apt-get install python-pip seems to have done the trick. This bring pip up to 1.5.4 and avoids the error above. Also, be sure to use /user/local/bin/pip for the rest of the provisioning script.

I'm not sure what changed to make my provisioning dependent on pip > 1.0 though. Would be nice to know so that I can lock that dependency down.

OTHER TIPS

Erik, while your answer may work it's not necessary I don't think. Have you tried apt-get install virtualenvwrapper?

The reason I ask is that ubuntu already has you "sudo apt-get install python-virtualenv" (which also installs python-pip), and I had no problem also apt-get install'ing virtualenvwrapper. The only difference is you have to "source /etc/bash_completion.d/virtualenvwrapper" in your bashrc instead of /usr/local/bin/virtualenvwrapper.sh.

You can still try back your way out of what you've done (don't blame me if it doesn't work though!):

$ sudo apt-get uninstall python-pip
$ sudo apt-get install python-pip
$ sudo pip uninstall virtualenvwrapper
$ sudo apt-get install virtualenvwrapper
then add source /etc/bash_completion.d/virtualenvwrapper to ~/.bashrc

Something like that. Good luck!

You can try sudo apt-get install python-virtualenv virtualenwrapper.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top