我正在使用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版本的原因是因爲當搜索軟件包時,較新的版本將點(.)
轉換爲破折號(-)
,並且沒有找到我需要的一些軟件包。