我正在从事一个项目。我创建了virtualenv
并安装了几个软件包。在项目工作一段时间后,pip
开始引发异常。
全球pip
无问题地工作。
这是在Django
项目中,我在AJAX
帖子(csrf_token
免除)工作。
每次输入pip install *
(venv) C:\Users\Milano\PycharmProjects\diplomova_praca\PriceCheckingProject>pip
install django-tables2
Exception:
Traceback (most recent call last):
File "c:\users\milano\pycharmprojects\diplomova_praca\pricecheckingproject\ven
v\lib\site-packages\pip\basecommand.py", line 211, in main
status = self.run(options, args)
File "c:\users\milano\pycharmprojects\diplomova_praca\pricecheckingproject\ven
v\lib\site-packages\pip\commands\install.py", line 245, in run
with self._build_session(options) as session:
File "c:\users\milano\pycharmprojects\diplomova_praca\pricecheckingproject\ven
v\lib\site-packages\pip\basecommand.py", line 71, in _build_session
insecure_hosts=options.trusted_hosts,
File "c:\users\milano\pycharmprojects\diplomova_praca\pricecheckingproject\ven
v\lib\site-packages\pip\download.py", line 316, in __init__
self.headers["User-Agent"] = user_agent()
File "c:\users\milano\pycharmprojects\diplomova_praca\pricecheckingproject\ven
v\lib\site-packages\pip\download.py", line 117, in user_agent
json=json.dumps(data, separators=(",", ":"), sort_keys=True),
KeyError: 'post_data'
Traceback (most recent call last):
File "c:\python27\Lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\Lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Users\Milano\PycharmProjects\diplomova_praca\PriceCheckingProject\ven
v\Scripts\pip.exe\__main__.py", line 9, in <module>
File "c:\users\milano\pycharmprojects\diplomova_praca\pricecheckingproject\ven
v\lib\site-packages\pip\__init__.py", line 217, in main
return command.main(cmd_args)
File "c:\users\milano\pycharmprojects\diplomova_praca\pricecheckingproject\ven
v\lib\site-packages\pip\basecommand.py", line 247, in main
timeout=min(5, options.timeout)) as session:
File "c:\users\milano\pycharmprojects\diplomova_praca\pricecheckingproject\ven
v\lib\site-packages\pip\basecommand.py", line 71, in _build_session
insecure_hosts=options.trusted_hosts,
File "c:\users\milano\pycharmprojects\diplomova_praca\pricecheckingproject\ven
v\lib\site-packages\pip\download.py", line 316, in __init__
self.headers["User-Agent"] = user_agent()
File "c:\users\milano\pycharmprojects\diplomova_praca\pricecheckingproject\ven
v\lib\site-packages\pip\download.py", line 117, in user_agent
json=json.dumps(data, separators=(",", ":"), sort_keys=True),
KeyError: 'post_data'