今天一直尝试在PyCharm里面安装jieba库,但是每次都是出错,观察之后发现是超时了,于是国内的镜像网站就好了
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple jieba
File “d:\program files (x86)\python\lib\http\client.py”, line 447,
in read
n = self.readinto(b) File “d:\program files (x86)\python\lib\http\client.py”, line 491, in readinto
n = self.fp.readinto(b) File “d:\program files (x86)\python\lib\socket.py”, line 589, in readinto
return self._sock.recv_into(b) File “d:\program files (x86)\python\lib\ssl.py”, line 1052, in recv_into
return self.read(nbytes, buffer) File “d:\program files (x86)\python\lib\ssl.py”, line 911, in read
return self._sslobj.read(len, buffer) socket.timeout: The read operation timed outDuring handling of the above exception, another exception occurred:
Traceback (most recent call last): File “d:\program files
(x86)\python\lib\site-packages\pip_internal\cli\base_command.py”,
line 186, in _main
status = self.run(options, args) File “d:\program files (x86)\python\lib\site-packages\pip_internal\commands\install.py”,
line 331, in run
resolver.resolve(requirement_set) File “d:\program files (x86)\python\lib\site-packages\pip_internal\legacy_resolve.py”, line
177, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req)) File “d:\program files
(x86)\python\lib\site-packages\pip_internal\legacy_resolve.py”, line
333, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install) File “d:\program files
(x86)\python\lib\site-packages\pip_internal\legacy_resolve.py”, line
282, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req) File “d:\program files
(x86)\python\lib\site-packages\pip_internal\operations\prepare.py”,
line 482, in prepare_linked_requirement
hashes=hashes, File “d:\program files (x86)\python\lib\site-packages\pip_internal\operations\prepare.py”,
line 287, in unpack_url
hashes=hashes, File “d:\program files (x86)\python\lib\site-packages\pip_internal\operations\prepare.py”,
line 159, in unpack_http_url
link, downloader, temp_dir.path, hashes File “d:\program files (x86)\python\lib\site-packages\pip_internal\operations\prepare.py”,
line 303, in _download_http_url
for chunk in download.chunks: File “d:\program files (x86)\python\lib\site-packages\pip_internal\utils\ui.py”, line 160,
in iter
for x in it: File “d:\program files (x86)\python\lib\site-packages\pip_internal\network\utils.py”, line
39, in response_chunks
decode_content=False, File “d:\program files (x86)\python\lib\site-packages\pip_vendor\urllib3\response.py”, line
564, in stream
data = self.read(amt=amt, decode_content=decode_content) File “d:\program files
(x86)\python\lib\site-packages\pip_vendor\urllib3\response.py”, line
529, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining) File “d:\program files (x86)\python\lib\contextlib.py”, line 130, in
exit
self.gen.throw(type, value, traceback) File “d:\program files (x86)\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.
不仅仅是jieba库,其他库也支持,下面给出原网址,使用方法
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package