我使用vagrant和virtualenv / virtualenvwrapper构建开发环境。最近,我的流浪盒正确地停止了配置。似乎virtualenvwrapper将不再安装。我试图追查改变了什么。 发生了什么变化?
我的Vagrantfile和install.sh文件位于:https://gist.github.com/ErikEvenson/9763878。请注意,此错误发生在网络框上。
这是我在尝试安装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
答案 0 :(得分:2)
我问的原因是ubuntu已经拥有你&#34; sudo apt-get install python-virtualenv&#34; (也安装python-pip),我也没有问题apt-get install&virthualenvwrapper。唯一的区别是你需要&#34;来源/etc/bash_completion.d/virtualenvwrapper"在你的bashrc而不是/usr/local/bin/virtualenvwrapper.sh。
你仍然可以尝试一下你已经做过的事情(如果它不起作用,不要怪我!):
$ 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
这样的事情。祝你好运!
答案 1 :(得分:0)
在执行pip install --upgrade pip
之后运行apt-get install python-pip
似乎已经完成了这个伎俩。这使得pip达到1.5.4并避免上述错误。此外,请务必使用/user/local/bin/pip
作为配置脚本的其余部分。
我不知道是什么改变了让我的配置依赖于pip&gt;但是1.0。很高兴知道我可以锁定这种依赖。
答案 2 :(得分:0)
你可以试试 sudo apt-get install python-virtualenv virtualenwrapper。