我正在使用python2.7 virtualenv(版本15.0.1)在Ubuntu 16.04上工作。 当我创建一个新的virtualenv时,它会自动安装pip(版本8.1.1)。 我想降级画中画8.0.2版本,但在运行时在virtualenv上降级pip失败
pip install pip==8.0.2
我得到以下错误:
Exception:
Traceback (most recent call last):
File "/mnt/code/.venvs/bla/local/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/mnt/code/.venvs/bla/local/lib/python2.7/site-packages/pip/commands/install.py", line 328, in run
wb.build(autobuilding=True)
File "/mnt/code/.venvs/bla/local/lib/python2.7/site-packages/pip/wheel.py", line 748, in build
self.requirement_set.prepare_files(self.finder)
File "/mnt/code/.venvs/bla/local/lib/python2.7/site-packages/pip/req/req_set.py", line 360, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/mnt/code/.venvs/bla/local/lib/python2.7/site-packages/pip/req/req_set.py", line 448, in _prepare_file
req_to_install, finder)
File "/mnt/code/.venvs/bla/local/lib/python2.7/site-packages/pip/req/req_set.py", line 387, in _check_skip_installed
req_to_install.check_if_exists()
File "/mnt/code/.venvs/bla/local/lib/python2.7/site-packages/pip/req/req_install.py", line 1011, in check_if_exists
self.req.project_name
AttributeError: 'Requirement' object has no attribute 'project_name'
然而,virtualenv中的作品外运行它。
有没有人知道这个问题的解决方案?
我想降级pip版本的原因是因为当搜索软件包时,较新的版本将点(.)
转换为破折号(-)
,并且没有找到我需要的一些软件包。