簡體   English   中英

我在嘗試安裝 django 時收到錯誤代碼

[英]I got the error code trying to install django

Traceback(最近一次調用最后一次):文件“C:\Users\HP\myproject\lib\site-packages\pip_vendor\urllib3\response.py”,第 438 行,在 _error_catcher 產生文件“C:\Users\HP\myproject \lib\site-packages\pip_vendor\urllib3\response.py",第 519 行,在讀取數據中 = self._fp.read(amt) if not fp_closed else b"" File "C:\Users\HP\myproject\lib \site-packages\pip_vendor\cachecontrol\filewrapper.py”,第 62 行,在讀取數據 = self.__fp.read(amt) 文件“C:\Users\HP\AppData\Local\Programs\Python\Python310\lib\ http\client.py”,第 465 行,讀取 s = self.fp.read(amt) 文件“C:\Users\HP\AppData\Local\Programs\Python\Python310\lib\socket.py”,第 705 行,在 readinto 中返回 self._sock.recv_into(b) 文件“C:\Users\HP\AppData\Local\Programs\Python\Python310\lib\ssl.py”,第 1273 行,在 recv_into 中返回 self.read(nbytes,緩沖區)文件“C:\Users\HP\AppData\Local\Programs\Python\Python310\lib\ssl.py”,第 1129 行,在讀取中返回 self._sslobj.read(len, buffer) TimeoutError:讀取操作計時出去

在處理上述異常的過程中,又出現了一個異常:

Traceback(最近一次調用最后一次):文件“C:\Users\HP\myproject\lib\site-packages\pip_internal\cli\base_command.py”,第 173 行,在 _main status = self.run(options, args) 文件中“C:\Users\HP\myproject\lib\site-packages\pip_internal\cli\req_command.py”,第 203 行,在包裝返回 func(self, options, args) 文件“C:\Users\HP\myproject\ lib\site-packages\pip_internal\commands\install.py",第 315 行,運行中 requirements_set = resolver.resolve( File "C:\Users\HP\myproject\lib\site-packages\pip_internal\resolution\resolvelib\resolver .py",第 94 行,解析結果 = self._result = resolver.resolve( 文件 "C:\Users\HP\myproject\lib\site-packages\pip_vendor\resolvelib\resolvers.py",第 472 行,解析state = resolution.resolve(requirements, max_rounds=max_rounds) 文件“C:\Users\HP\myproject\lib\site-packages\pip_vendor\resolvelib\resolvers.py”,第 341 行,在解析 self._add_to_criteria(self.Z9ED39E2EA93142EF586666 .標准,r , parent=None) 文件“C:\Users\HP\myproject\lib\site-packages\pip_vendor\resolvelib\resolvers.py”,第 172 行,在 _add_to_criteria 中,如果不是criteria.candidates:文件“C:\Users\HP \myproject\lib\site-packages\pip_vendor\resolvelib\structs.py”,第 151 行,在bool return bool(self._sequence) 文件“C:\Users\HP\myproject\lib\site-packages\pip_internal\resolution \resolvelib\found_candidates.py”,第 140 行,在bool中返回任何(自身)文件“C:\Users\HP\myproject\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py”,第 128 行,在return (c for c in iterator if id(c) not in self._incompatible_ids) 文件“C:\Users\HP\myproject\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py”,第 32 行,在_iter_built 候選 = func() 文件“C:\Users\HP\myproject\lib\site-packages\pip_internal\resolution\resolvelib\factory.py”,第 204 行,在 _make_candidate_from_link self._link_candidate_cache[link] = LinkCandidate(File" C:\Users\HP\myproject\lib\ site-packages\pip_internal\resolution\resolvelib\candidates.py",第 295 行,在init super() 中。 init (文件“C:\Users\HP\myproject\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py”,第 156 行,在init self.dist = self._prepare() 文件“C:\Users \HP\myproject\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py”,第 227 行,在 _prepare dist = self._prepare_distribution() 文件“C:\Users\HP\myproject\lib\site-packages \pip_internal\resolution\resolvelib\candidates.py”,第 305 行,在 _prepare_distribution 中返回 self._factory.preparer.prepare_linked_requirement(文件“C:\Users\HP\myproject\lib\site-packages\pip_internal\operations\prepare.py ”,第 508 行,在 prepare_linked_requirement 中返回 self._prepare_linked_requirement(req,parallel_builds) 文件“C:\Users\HP\myproject\lib\site-packages\pip_internal\operations\prepare.py”,第 550 行,在 _prepare_linked_requirement local_file = unpack_url (文件“C:\Users\HP\myproject\lib\site-packages\pip_internal\operations\prepare.py”,第 239 行,在 unpack_url 文件 = get_http_url(文件“C:\Users\HP\myproject\lib\site -包裝 es\pip_internal\operations\prepare.py”,第 102 行,在 get_http_url from_path,content_type = download(link, temp_dir.path) 文件“C:\Users\HP\myproject\lib\site-packages\pip_internal\network\download .py",第 145 行,在塊中調用塊:文件 "C:\Users\HP\myproject\lib\site-packages\pip_internal\cli\progress_bars.py",第 144 行,在 iter for x 中:文件“C:\Users\HP\myproject\lib\site-packages\pip_internal\network\utils.py”,第 63 行,在 response_chunks 中,用於 response.raw.stream 中的塊(文件“C:\Users\HP\myproject \lib\site-packages\pip_vendor\urllib3\response.py",第 576 行,在 stream 中數據 = self.read(amt=amt, decode_content=decode_content) 文件“C:\Users\HP\myproject\lib\site- packages\pip_vendor\urllib3\response.py",第 512 行,使用 self._error_catcher() 讀取:文件 "C:\Users\HP\AppData\Local\Programs\Python\Python310\lib\contextlib.py",行153、在退出self.gen.throw(typ, value, traceback) 文件“C:\Users\HP\myproject\lib\site-packages\pip_vendor\urlli b3\response.py",第 443 行,在 _error_catcher 中引發 ReadTimeoutError(self._pool, None, "Read timed out.") pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): 讀取超時。

在虛擬環境中測試 Django 安裝,在 cmd 中:

> python -m venv env
> cd env/Scripts/activate
> pip install django

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM