Pip突然在virtualenv中不起作用

时间:2016-05-19 17:31:13

标签: python pip virtualenv pypy

我正在从事一个项目。我创建了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'

0 个答案:

没有答案