pip错误incompleteread

解决Ubuntu下pip安装失败
本文解决了在Ubuntu系统中使用pip安装Python包时遇到的incompleteread错误。通过卸载原有pip并采用源码方式重新安装,最终解决了安装过程中出现的问题。

安装python包时,pip一直报错,incompleteread,还以为是安装包的问题。后来发现,大部分用pip安装包时,都不能成功,而且都是这个错误。这样就怀疑是不是pip错误了。

网上查资料,发现果然如我所料。就是用ubuntu自带的安装会出错。

sudo apt-get install python-pip

那么就要缷载之前安装的pip

    sudo apt-get remove python-pip
    sudo apt-get autoremove

再源码安装

wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate
sudo python get-pip.py

听说还有个源的问题,就是用pip安装时,会用到源

如果不修改~/.pip文件或没有这个,就用默认的


之前我记得openjava也出现过问题,改换oracl java就搞定了,害得我耗时多日终无果。看来不能相信系统中的包了

Downloading pip-24.0-py3-none-any.whl (2.1 MB) |███ | 184 kB 25 kB/s eta 0:01:15ERROR: Exception: Traceback (most recent call last): File "D:\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 425, in _error_catcher yield File "D:\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 507, in read data = self._fp.read(amt) if not fp_closed else b"" File "D:\python\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read data = self.__fp.read(amt) File "D:\python\lib\http\client.py", line 461, in read n = self.readinto(b) File "D:\python\lib\http\client.py", line 505, in readinto n = self.fp.readinto(b) File "D:\python\lib\socket.py", line 589, in readinto return self._sock.recv_into(b) File "D:\python\lib\ssl.py", line 1071, in recv_into return self.read(nbytes, buffer) File "D:\python\lib\ssl.py", line 929, in read return self._sslobj.read(len, buffer) socket.timeout: The read operation timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\python\lib\site-packages\pip\_internal\cli\base_command.py", line 188, in _main status = self.run(options, args) File "D:\python\lib\site-packages\pip\_internal\cli\req_command.py", line 185, in wrapper return func(self, options, args) File "D:\python\lib\site-packages\pip\_internal\commands\install.py", line 333, in run reqs, check_supported_wheels=not options.target_dir File "D:\python\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 179, in resolve discovered_reqs.extend(self._resolve_one(requirement_set, req)) File "D:\python\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 362, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File "D:\python\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 314, in _get_abstract_dist_for abstract_dist = self.preparer.prepare_linked_requirement(req) File "D:\python\lib\site-packages\pip\_internal\operations\prepare.py", line 469, in prepare_linked_requirement hashes=hashes, File "D:\python\lib\site-packages\pip\_internal\operations\prepare.py", line 259, in unpack_url hashes=hashes, File "D:\python\lib\site-packages\pip\_internal\operations\prepare.py", line 130, in get_http_url link, downloader, temp_dir.path, hashes File "D:\python\lib\site-packages\pip\_internal\operations\prepare.py", line 281, in _download_http_url for chunk in download.chunks: File "D:\python\lib\site-packages\pip\_internal\cli\progress_bars.py", line 166, in iter for x in it: File "D:\python\lib\site-packages\pip\_internal\network\utils.py", line 39, in response_chunks decode_content=False, File "D:\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 564, in stream data = self.read(amt=amt, decode_content=decode_content) File "D:\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 529, in read raise IncompleteRead(self._fp_bytes_read, self.length_remaining) File "D:\python\lib\contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "D:\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 430, in _error_catcher raise ReadTimeoutError(self._pool, None, "Read timed out.") pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
最新发布
09-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值