为了账号安全,请及时绑定邮箱和手机立即绑定

Ubuntu14.10使用pip1.5.6提示readline()错误

Ubuntu14.10使用pip1.5.6提示readline()错误

吃鸡游戏 2019-04-08 09:21:35
今天在用pip1.5.6安装flask-mongoengine的时候报错退出我执行的命令是bashpipinstallflask-mongoengine返回错误是bashDownloading/unpackingflask-mongoengineCleaningup...Exception:Traceback(mostrecentcalllast):File"/usr/lib/python2.7/dist-packages/pip/basecommand.py",line122,inmainstatus=self.run(options,args)File"/usr/lib/python2.7/dist-packages/pip/commands/install.py",line278,inrunrequirement_set.prepare_files(finder,force_root_egg_info=self.bundle,bundle=self.bundle)File"/usr/lib/python2.7/dist-packages/pip/req.py",line1177,inprepare_filesurl=finder.find_requirement(req_to_install,upgrade=self.upgrade)File"/usr/lib/python2.7/dist-packages/pip/index.py",line194,infind_requirementpage=self._get_page(main_index_url,req)File"/usr/lib/python2.7/dist-packages/pip/index.py",line568,in_get_pagesession=self.session,File"/usr/lib/python2.7/dist-packages/pip/index.py",line670,inget_pageresp=session.get(url,headers={"Accept":"text/html"})File"/usr/lib/python2.7/dist-packages/requests/sessions.py",line468,ingetreturnself.request('GET',url,**kwargs)File"/usr/lib/python2.7/dist-packages/pip/download.py",line237,inrequestreturnsuper(PipSession,self).request(method,url,*args,**kwargs)File"/usr/lib/python2.7/dist-packages/requests/sessions.py",line456,inrequestresp=self.send(prep,**send_kwargs)File"/usr/lib/python2.7/dist-packages/requests/sessions.py",line559,insendr=adapter.send(request,**kwargs)File"/usr/lib/python2.7/dist-packages/requests/adapters.py",line327,insendtimeout=timeoutFile"/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py",line491,inurlopenconn=self._get_conn(timeout=pool_timeout)File"/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py",line230,in_get_connreturnconnorself._new_conn()File"/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py",line680,in_new_connreturnself._prepare_conn(conn)File"/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py",line653,in_prepare_connconn.connect()File"/usr/lib/python2.7/dist-packages/urllib3/connection.py",line205,inconnectself._tunnel()File"/usr/lib/python2.7/httplib.py",line780,in_tunnelline=response.fp.readline(_MAXLINE+1)TypeError:readline()takesexactly1argument(2given)我看traceback怀疑是标准库的bug,就google了一下,发现了一个github上的issue,场景不一样但是引发了同样的bug。这个issue最后讨论的结论是这确实是个bug,但是相关的patch已经merge了,就是说问题应该已经解决了。我在issue后面回复了我的问题,不过还没有得到解决。不知道有没有哪位遇到过类似的问题并且已经解决了?我的python版本是2.7.9,pip版本是1.5.6,系统是ubuntu14.10.
查看完整描述

2 回答

?
慕工程0101907

TA贡献1887条经验 获得超5个赞

我在用pip安装其他扩展的时候出现报错的原因很多情况下是因为没有加超级用户权限
试一下sudopipinstallflask-mongoengine
                            
查看完整回答
反对 回复 2019-04-08
  • 2 回答
  • 0 关注
  • 436 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信