pip安装库时出现Read timed out.解决办法

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_38316655/article/details/81463917

在安装python库,在网络不好的情况会遇到

raise ReadTimeoutError(self._pool, None, 'Read timed out.')
ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.


解决办法1:延长timeout时间

raise ReadTimeoutError(self._pool, None, 'Read timed out.')
ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.


pip --default-timeout=100 install Package

将Package替换你所需要的库就行

 


解决办法2:换源

    #例如安装scipy时使用豆瓣的源
    pip install --index-url https://pypi.douban.com/simple scipy
    #使用清华大学的源
    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple –upgrade tensorflow-gpu

 

展开阅读全文

Stateful bean was removed or timed out.

12-20

超时时间设置为30分钟,但是不到10分钟后再去访问该Stateful bean,就发现该bean已经不存在了,rn日志如下:rnCaused by: javax.ejb.NoSuchEJBException: Stateful bean BeanId(spms-ear#spms-ejb.jar#MesysRoleActionBean, AB28C028-0125-4000-E000-0364805A011F) was removed or timed out.rn at com.ibm.ejs.container.activator.StatefulSessionActivationStrategy.atActivate(StatefulSessionActivationStrategy.java:241)rn at com.ibm.ejs.container.activator.Activator.activateBean(Activator.java:599)rn at com.ibm.ejs.container.EJSContainer.preInvokeActivate(EJSContainer.java:3919)rn at com.ibm.ejs.container.EJSContainer.EjbPreInvoke(EJSContainer.java:3304)rn at com.spms.mesys.action.EJSLocal0SFMesysRoleActionBean_14738250.getCodes(EJSLocal0SFMesysRoleActionBean_14738250.java)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)rn at java.lang.reflect.Method.invoke(Method.java:599)rn at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)rn at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)rn at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)rn at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)rn at org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163)rn at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)rn at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:43)rn at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)rn at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)rn at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)rn at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)rn at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)rn at org.javassist.tmp.java.lang.Object_$$_javassist_seam_21.getCodes(Object_$$_javassist_seam_21.java)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)rn at java.lang.reflect.Method.invoke(Method.java:599)rn at javax.el.BeanELResolver.getValue(BeanELResolver.java:273)rn at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)rn at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:73)rn at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)rn at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)rn at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)rn at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)rn ... 62 more 论坛

java.net.SocketTimeoutException: Read timed out

12-02

java.net.SocketTimeoutException: Read timed outrn at java.net.SocketInputStream.socketRead0(Native Method)rn at java.net.SocketInputStream.read(Unknown Source)rn at java.io.BufferedInputStream.fill(Unknown Source)rn at java.io.BufferedInputStream.read(Unknown Source)rn at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:77)rn at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:105)rn at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1115)rn at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1832)rn at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590)rn at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)rn at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)rn at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)rn at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)rn at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)rn at com.dianjing.api.sem.v1.DianjingApiUtils.getResponseByApi(DianjingApiUtils.java:47)rn at com.dianjing.api.sem.v1.DianjingApiUtils.getResponseByApi(DianjingApiUtils.java:73)rn at com.dianjing.api.sem.v2.creative.Creativeconnector.getInfoByIdList(Creativeconnector.java:46)rn at com.dianjing.api.sem.v1.ConnectorOperation.getcreativeinfo(ConnectorOperation.java:493)rn at cn.info.platform.quartz.QuartzCreativeallJob.execute(QuartzCreativeallJob.java:52)rn at org.quartz.core.JobRunShell.run(JobRunShell.java:202)rn at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)rn2013-12-02 11:21:38,574 ERROR (org.quartz.core.JobRunShell:211) - Job EXTJWEB_JOBGROUP_NAME.92 threw an unhandled Exception: rnjava.lang.NullPointerExceptionrn at org.dom4j.DocumentHelper.getEncoding(DocumentHelper.java:292)rn at org.dom4j.DocumentHelper.parseText(DocumentHelper.java:273)rn at com.dianjing.api.sem.v1.XmlUtils.Dom2Map(XmlUtils.java:26)rn at com.dianjing.api.sem.v1.ConnectorOperation.getcreativeinfo(ConnectorOperation.java:492)rn at cn.info.platform.quartz.QuartzCreativeallJob.execute(QuartzCreativeallJob.java:52)rn at org.quartz.core.JobRunShell.run(JobRunShell.java:202)rn at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)rn2013-12-02 11:21:38,574 ERROR (org.quartz.core.ErrorLogger:2185) - Job (EXTJWEB_JOBGROUP_NAME.92 threw an exception.rnorg.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NullPointerException]rn at org.quartz.core.JobRunShell.run(JobRunShell.java:213)rn at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)rnCaused by: java.lang.NullPointerExceptionrn at org.dom4j.DocumentHelper.getEncoding(DocumentHelper.java:292)rn at org.dom4j.DocumentHelper.parseText(DocumentHelper.java:273)rn at com.dianjing.api.sem.v1.XmlUtils.Dom2Map(XmlUtils.java:26)rn at com.dianjing.api.sem.v1.ConnectorOperation.getcreativeinfo(ConnectorOperation.java:492)rn at cn.info.platform.quartz.QuartzCreativeallJob.execute(QuartzCreativeallJob.java:52)rn at org.quartz.core.JobRunShell.run(JobRunShell.java:202)rn ... 1 morern现在在做一个项目,调用360给的接口获取数据,由于有的数据过多,其实也就几千条,可是获取的时候要先进行获取相关的信息才能获取最后想要的,一层一层获取,在main函数里测试用了20多W毫秒,可是当我在web程序调用我那方法的时候就报错,最后用quartz做成任务也报这错java.net.SocketTimeoutException: Read timed out。求大神解决 论坛

org.apache.commons.fileupload.FileUploadException: Read timed out

11-16

求助,程序用的框架为struts2+hibernate+spring,运行环境为weblogic,用excel把数据导入数据库,如果excel中行数比较多(40000行左右),程序异常,后台报rnorg.apache.commons.fileupload.FileUploadException: Read timed outrn at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:381)rn at org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest.parse(JakartaMultiPartRequest.java:93)rn at org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper.(MultiPartRequestWrapper.java:75)rn at org.apache.struts2.dispatcher.Dispatcher.wrapRequest(Dispatcher.java:663)rn at org.apache.struts2.dispatcher.FilterDispatcher.prepareDispatcherAndWrapRequest(FilterDispatcher.java:327)rn at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:367)rn at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)rn at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:26)rn at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)rn at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3393)rn at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)rn at weblogic.security.service.SecurityManager.runAs(Unknown Source)rn at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2140)rn at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2046)rn at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)rn at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)rn at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)rnCaused by: java.net.SocketTimeoutException: Read timed outrn。。。。。。。rnrn错误,但是行数少的时候没有问题,(20000行以下没问题,40000行有时有问题,有时没有问题)。我看了后台,数据已经导入到数据库中了,action的最后一条语句是插入日志,日志也插入了。就是报异常,不知道怎么回事。哪位大哥大姐遇到过这样的问题,怎么解决的,望不吝告知,先谢过了。 论坛

org.apache.axis2.AxisFault: Read timed out

06-26

1、wsdl2java -s -Etypesystemname qqOnlineWebService -uri http://www.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl -Etypesystemname -trn生成一个MobileCodeWSStub.java文件,还有MobileCodeWSTest.java.rn结果MobileCodeWSTest运行的时候报错如下,该怎么解决。rn部分代码如下:rnpublic void testgetMobileCodeInfo() throws java.lang.Exceptionrnrn cn.com.webxml.MobileCodeWSStub stub =rn new cn.com.webxml.MobileCodeWSStub();//the default implementation should point to the right endpointrnrn cn.com.webxml.MobileCodeWSStub.GetMobileCodeInfo getMobileCodeInfo6=rn (cn.com.webxml.MobileCodeWSStub.GetMobileCodeInfo)getTestObject(cn.com.webxml.MobileCodeWSStub.GetMobileCodeInfo.class);rn // TODO : Fill in the getMobileCodeInfo6 herern getMobileCodeInfo6.setMobileCode("13621778722");rn getMobileCodeInfo6.setUserID("");rn assertNotNull(stub.getMobileCodeInfo(rn getMobileCodeInfo6));rn rn这个问题如何解决rnorg.apache.axis2.AxisFault: Read timed outrn at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)rn at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)rn at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)rn at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)rn at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)rn at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)rn at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)rn at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)rn at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)rn at cn.com.webxml.MobileCodeWSStub.getMobileCodeInfo(MobileCodeWSStub.java:319)rn at cn.com.webxml.MobileCodeWSTest.testgetMobileCodeInfo(MobileCodeWSTest.java:52)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at junit.framework.TestCase.runTest(TestCase.java:168)rn at junit.framework.TestCase.runBare(TestCase.java:134)rn at junit.framework.TestResult$1.protect(TestResult.java:110)rn at junit.framework.TestResult.runProtected(TestResult.java:128)rn at junit.framework.TestResult.run(TestResult.java:113)rn at junit.framework.TestCase.run(TestCase.java:124)rn at junit.framework.TestSuite.runTest(TestSuite.java:232)rn at junit.framework.TestSuite.run(TestSuite.java:227)rn at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:79)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)rnCaused by: java.net.SocketTimeoutException: Read timed outrn at java.net.SocketInputStream.socketRead0(Native Method)rn at java.net.SocketInputStream.read(Unknown Source)rn at java.io.BufferedInputStream.fill(Unknown Source)rn at java.io.BufferedInputStream.read(Unknown Source)rn at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)rn at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)rn at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)rn at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)rn at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)rn at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)rn at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)rn at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)rn at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)rn at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)rn at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)rn at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)rn at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:189)rn ... 28 more 论坛

Read timed out

04-08

直接贴代码: rn客户端: rn[code=Java]rnrnpublic class Communicator rnrn private static final Log log = LogFactory.getLog(Communicator.class);rnrn private static String ADDRESS = "";rnrn private static int PORT = 0;rnrn /* 通讯对象 */rn private static Socket socket = null;rnrn private static BufferedReader in = null;rn private static PrintWriter out = null;rnrn rn public String sendMessage(String message) throws EbillsException rnrn String returnStr = "";rnrn try rnrn ADDRESS = "127.0.0.1";rn PORT = 8877;rn socket = new Socket(ADDRESS, PORT);rn socket.setSoTimeout(10000);rn in = new BufferedReader(new InputStreamReader(socketrn .getInputStream()));rn out = new PrintWriter(socket.getOutputStream());rn out.print(message);rn out.flush();rn returnStr = in.readLine();rnrn return returnStr;rn catch (Exception e) rn e.printStackTrace();rnrn finally rn releaseAll(out,in,socket);rn rnrn rn rn rn rn public static void main(String[] args) throws EbillsException rn Communicator communicator = new Communicator();rn communicator.sendMessage(new String("0000000000000000000"));rn rnrnrnrn[/code]rn服务端rn[code=Java]rnpublic class SoketServerTmp rn rn rn // 临时server rn rn public SoketServerTmp() throws Exception rn Socket client =null; rn try rn ServerSocket server=new ServerSocket(8877); rn client = server.accept(); rn BufferedReader in=new BufferedReader(new InputStreamReader(client.getInputStream())); rn PrintWriter out=new PrintWriter(client.getOutputStream()); rn rn while(true) rn String str=in.readLine(); rn //System.out.println(str); rn out.println("服务端has received...." + str); rn out.flush(); rn rn rn catch (Exception e) rn // TODO: handle exception rn finally rn client.close(); rn rn rn rn public static void main(String[] args) throws Exception rn new SoketServerTmp(); rn rn rnrnrnpublic class SoketServerTmp rnrn rn // 临时serverrnrn public SoketServerTmp() throws Exception rn Socket client =null;rn tryrn ServerSocket server=new ServerSocket(8877); rn client = server.accept(); rn BufferedReader in=new BufferedRead[code=Java][/code]er(new InputStreamReader(client.getInputStream())); rn PrintWriter out=new PrintWriter(client.getOutputStream()); rn rn while(true) rn String str=in.readLine(); rn //System.out.println(str); rn out.println("服务端has received...." + str); rn out.flush(); rn rn rn catch (Exception e) rn // TODO: handle exceptionrn finallyrn client.close();rn rn rn rn public static void main(String[] args) throws Exceptionrn new SoketServerTmp();rn rnrnrn[/code]rnrn问题,先启动服务端,然后启动客户端,怎么服务端一直都接收不了客户端的信息,然后还抛出 rnjava.net.SocketTimeoutException: Read timed out rnat java.net.SocketInputStream.socketRead0(Native Method) rnat java.net.SocketInputStream.read(SocketInputStream.java:129) rnat java.net.SocketInputStream.read(SocketInputStream.java:90) rnat sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:285) rnat sun.nio.cs.StreamDecoder.read(StreamDecoder.java:182) rnat java.io.InputStreamReader.read(InputStreamReader.java:167) rnat java.io.BufferedReader.fill(BufferedReader.java:136) rnat java.io.BufferedReader.readLine(BufferedReader.java:299) rnat java.io.BufferedReader.readLine(BufferedReader.java:362) rnat com.amerisia.ebills.loanbycredit.ejb.Communicator.sendMessage(Communicator.java:61) rnat com.amerisia.ebills.loanbycredit.ejb.Communicator.main(Communicator.java:116) rn希望各位能够给解答一下 rnrn 论坛

没有更多推荐了,返回首页