以上就是给各位分享如何使用pip解决ReadTimeoutError:HTTPSConnectionPool,其中也会对host='pypi.python.org',port=443?进行解释,同时本
以上就是给各位分享如何使用pip解决ReadTimeoutError:HTTPSConnectionPool,其中也会对host ='pypi.python.org',port = 443?进行解释,同时本文还将给你拓展"from pymongo import Connection" (to import mongo.connection using python) , got "500 Internal Server Error"、(python pip 安装第三方库超时问题(raise ReadTimeoutErrorself._pool, None, ''Read timed out.'')、connect to host ssh.github.com port 22: Connection timed out解决方法、Connection open error . Connection Timeout Expired. The timeout period elapsed during the post-lo...等相关知识,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:- 如何使用pip解决ReadTimeoutError:HTTPSConnectionPool(host ='pypi.python.org',port = 443)?
- "from pymongo import Connection" (to import mongo.connection using python) , got "500 Internal Server Error"
- (python pip 安装第三方库超时问题(raise ReadTimeoutErrorself._pool, None, ''Read timed out.'')
- connect to host ssh.github.com port 22: Connection timed out解决方法
- Connection open error . Connection Timeout Expired. The timeout period elapsed during the post-lo...
如何使用pip解决ReadTimeoutError:HTTPSConnectionPool(host ='pypi.python.org',port = 443)?
我最近需要安装一些软件包
pip install futurepip install scikit-learnpip install numpypip install scipy
我sudo
在他们之前也尝试过writin ,但是所有这些都以红线显示了以下错误:
Exception:Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main status = self.run(options, args) File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 290, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1198, in prepare_files do_download, File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1376, in unpack_url self.session, File "/usr/lib/python2.7/dist-packages/pip/download.py", line 572, in unpack_http_url download_hash = _download_url(resp, link, temp_location) File "/usr/lib/python2.7/dist-packages/pip/download.py", line 433, in _download_url for chunk in resp_read(4096): File "/usr/lib/python2.7/dist-packages/pip/download.py", line 421, in resp_read chunk_size, decode_content=False): File "/usr/lib/python2.7/dist-packages/urllib3/response.py", line 256, in stream data = self.read(amt=amt, decode_content=decode_content) File "/usr/lib/python2.7/dist-packages/urllib3/response.py", line 201, in read raise ReadTimeoutError(self._pool, None, ''Read timed out.'')ReadTimeoutError: HTTPSConnectionPool(host=''pypi.python.org'', port=443): Read timed out.Storing debug log for failure in /root/.pip/pip.log''
答案1
小编典典耶!我找到了答案。只需在安装中使用–default-timeout = 100参数即可。例如
sudo pip install --default-timeout=100 future
"from pymongo import Connection" (to import mongo.connection using python) , got "500 Internal Server Error"
I created the /var/www/cgi-bin/test.py in my web server machine (Linux). The service of mongoDB "mongod" is running.
When I run the test.py locally, "./test.py", I could get the correct result.
But when I use the URL: http://xxxxxx.compute-1.amazonaws.com/cgi-bin/python_test/test.py to run the test.py, I will get the "500 Internal Server Error".
If I remove the line "from pymongo import Connection", and use the URL above to access, I won''t get the 500 Internal server error. So, it should be the problem when I import the pymongo.connection.
Is it the problem of any configuration issue? Thanks so much for your help
========== test.py ==============
#!/usr/bin/python
import cgi
import sys
sys.path.append("/home/ec2-user/mongo-python-driver-2.6.3/")
#import pymongo.connection
from pymongo import Connection
def main():
print "Content-type: text/html\r\n\r\n"
form = cgi.FieldStorage()
name = form.getvalue(''ServiceCode'')
# name = "abcddd"
# con = Connection()
# db = con.test
# posts = db.post
# print name
if form.has_key("ServiceCode") and form["ServiceCode"].value!="":
print"<h1>Hello", form["ServiceCode"].value,"</h1>"
else:
print"<h1>Error! Please enter first name. </h1>"
.....
(python pip 安装第三方库超时问题(raise ReadTimeoutErrorself._pool, None, ''Read timed out.'')
(python pip 安装第三方库超时问题(raise ReadTimeoutErrorself._pool, None, ‘Read timed out.’)
pip 工具安装
百度经验链接: pip 安装及环境变量配置.
pip 下载超时处理
aise ReadTimeoutError(self._pool, None, ‘Read timed out.’)
方案一:对于比较小的库,可以延时处理
-------- pip --default-timeout=100 install -U pip
-------- pip --default-timeout=100 install 第三方库名
方案二:更换安装源
------------ 网上可以查找很多豆瓣源
如 https://pypi.tuna.tsinghua.edu.cn/simple/
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyecharts
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple 库名
出错使用这种 :pip install --index-url https://pypi.tuna.tsinghua.edu.cn/simple/ lightgbm
方案三:下载离线包
python 所有库:(https://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml)
--------- 然后通过 pip install 保存路径 / 加上下载的文件名 进行安装
(如 pip install C:\Users\HP\Desktop\scikit_image-0.14.1-cp37-cp37m-win32.whl)
————————————————
原文链接:https://blog.csdn.net/qq_40925385/article/details/83753598
connect to host ssh.github.com port 22: Connection timed out解决方法
ssh: connect to host ssh.github.com port 22: Connection timed out
ssh:连接到主机github.com端口22:连接超时
提示:连接到主机git@github.com端口20超时~~~
百度之后,可能是端口被占用;
解决办法:
在./ssh 下找到congfig文件,如果没有就创建一个
在config文件中复制下面代码:
Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
然后在执行
ssh -T git@github.com 查看是否可以链接;
成功
Connection open error . Connection Timeout Expired. The timeout period elapsed during the post-lo...
是这样的,最近我在开发Api(重构),用的数据库是Sqlserver,使用的Orm是 SqlSugar(别问我为什么选这个,boss选的同时我也想支持国人写的东西,且文档也很全)。
被催的是,写好了程序本地(windows10 pro 64 bit)运行正常,一部署到测试机器(centos7.2 64 bit)就报错:
报错1
An unhandled exception occurred while processing the request.
SqlSugarException: English Message : Connection open error . Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=48; handshake=124; [Login] initialization=0; authentication=0; [Post-Login] complete=14000; Chinese Message : 连接数据库过程中发生错误,检查服务器是否正常连接字符串是否正确,实在找不到原因请先Google错误信息:Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=48; handshake=124; [Login] initialization=0; authentication=0; [Post-Login] complete=14000; .
如图:
wtf!!!:为毛本地好好的,一丢到linux测试机(后面简称测试机)就出问题???
然后,我开始痛苦的排查了,从环境、框架,依赖注入,数据库网络;
telnet ping啊那些不用说了;
1、换台测试机 --> 测试机一样报错(排除本机玄学原因);
2、更新SqlSugar版本,从4.9.7更新到4.9.8.1--> 本地正常、测试机一样报错(基本排除驱动特地版本的bug);
3、用程序连接查询同网段的其他数据库 --> 本地正常、测试机一样报错(基本也排除网络原因);
4、连接我自己远程服务器的数据库 --> 本地正常、测试机正常--(排除linux驱动工作不正常或者程序时bug)
最后,我想想一直报超时。我都没增加超时时间(默认应该是15秒),我在连接字符串里面加了一个
Connect Timeout=300;//5分钟的超时时间
得,报的错变成了:
报错2
An unhandled exception occurred while processing the request.
SqlSugarException: English Message : Connection open error . A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 35 - An internal exception was caught) Chinese Message : 连接数据库过程中发生错误,检查服务器是否正常连接字符串是否正确,实在找不到原因请先Google错误信息:A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 35 - An internal exception was caught).
SqlSugar.AdoProvider.GetDataReader(string sql, SugarParameter[] parameters)
如图:
各种玄学的非玄学的方法都找完了,差点想提前打包回家了,我突然灵光一闪??会不会数据库版本问题!!!
最后发现了这个,
.net core 的System.Data.SqlClient支持的最低SqlServer版本是2008 r2 SP3,小于这个版本的就会报这个错。
https://github.com/dotnet/corefx/issues/9719
结论:
.netcore 连接使用sqlserver遇到以上报错1、报错2的同学,需注意:.net core 的System.Data.SqlClient支持的最低SqlServer版本是2008 r2 SP3请先检查数据库版本。
呼~这个鬼问题浪费了我整整两天+(3个熬夜)。
关于如何使用pip解决ReadTimeoutError:HTTPSConnectionPool和host ='pypi.python.org',port = 443?的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于"from pymongo import Connection" (to import mongo.connection using python) , got "500 Internal Server Error"、(python pip 安装第三方库超时问题(raise ReadTimeoutErrorself._pool, None, ''Read timed out.'')、connect to host ssh.github.com port 22: Connection timed out解决方法、Connection open error . Connection Timeout Expired. The timeout period elapsed during the post-lo...等相关知识的信息别忘了在本站进行查找喔。
本文标签: