AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
139.97k stars 26.51k forks source link

[Bug]: TimeoutError/error code: 2/Couldn't install torch #15554

Open Madbat1 opened 5 months ago

Madbat1 commented 5 months ago

Checklist

What happened?

when downloading it stops at 2.1/2.5 GB and gives the same error

Steps to reproduce the problem

  1. click webui.bat
  2. wait till 2.1/2.5 GB is downloaded
  3. Errors happen

What should have happened?

it should download normally

What browsers do you use to access the UI ?

No response

Sysinfo

not there yet

Console logs

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.9.0
Commit hash: adadb4e3c7382bf3e4f7519126cd6c70f4f8557b
Installing torch and torchvision
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu121
Collecting torch==2.1.2
  Downloading https://download.pytorch.org/whl/cu121/torch-2.1.2%2Bcu121-cp310-cp310-win_amd64.whl (2473.9 MB)
     ---------------------------------- ----- 2.1/2.5 GB 930.0 kB/s eta 0:05:50
ERROR: Exception:
Traceback (most recent call last):
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 438, in _error_catcher
    yield
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 561, in read
    data = self._fp_read(amt) if not fp_closed else b""
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 527, in _fp_read
    return self._fp.read(amt) if amt is not None else self._fp.read()
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 98, in read
    data: bytes = self.__fp.read(amt)
  File "http\client.py", line 465, in read
  File "socket.py", line 705, in readinto
  File "ssl.py", line 1274, in recv_into
  File "ssl.py", line 1130, in read
TimeoutError: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\cli\base_command.py", line 180, in exc_logging_wrapper
    status = run_func(*args)
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\cli\req_command.py", line 245, in wrapper
    return func(self, options, args)
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\commands\install.py", line 377, in run
    requirement_set = resolver.resolve(
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 95, in resolve
    result = self._result = resolver.resolve(
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 397, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 173, in _add_to_criteria
    if not criterion.candidates:
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_vendor\resolvelib\structs.py", line 156, in __bool__
    return bool(self._sequence)
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 155, in __bool__
    return any(self)
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 143, in <genexpr>
    return (c for c in iterator if id(c) not in self._incompatible_ids)
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 47, in _iter_built
    candidate = func()
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 182, in _make_candidate_from_link
    base: Optional[BaseCandidate] = self._make_base_candidate_from_link(
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 228, in _make_base_candidate_from_link
    self._link_candidate_cache[link] = LinkCandidate(
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 290, in __init__
    super().__init__(
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 156, in __init__
    self.dist = self._prepare()
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 222, in _prepare
    dist = self._prepare_distribution()
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 301, in _prepare_distribution
    return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\operations\prepare.py", line 525, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\operations\prepare.py", line 596, in _prepare_linked_requirement
    local_file = unpack_url(
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\operations\prepare.py", line 168, in unpack_url
    file = get_http_url(
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\operations\prepare.py", line 109, in get_http_url
    from_path, content_type = download(link, temp_dir.path)
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\network\download.py", line 147, in __call__
    for chunk in chunks:
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\cli\progress_bars.py", line 53, in _rich_progress_bar
    for chunk in iterable:
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_internal\network\utils.py", line 63, in response_chunks
    for chunk in response.raw.stream(
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 622, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 560, in read
    with self._error_catcher():
  File "contextlib.py", line 153, in __exit__
  File "C:\Users\User\Desktop\stabe diffiusion\system\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 443, in _error_catcher
    raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='download.pytorch.org', port=443): Read timed out.
Traceback (most recent call last):
  File "C:\Users\User\Desktop\stabe diffiusion\webui\launch.py", line 48, in <module>
    main()
  File "C:\Users\User\Desktop\stabe diffiusion\webui\launch.py", line 39, in main
    prepare_environment()
  File "C:\Users\User\Desktop\stabe diffiusion\webui\modules\launch_utils.py", line 380, in prepare_environment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
  File "C:\Users\User\Desktop\stabe diffiusion\webui\modules\launch_utils.py", line 115, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install torch.
Command: "C:\Users\User\Desktop\stabe diffiusion\system\python\python.exe" -m pip install torch==2.1.2 torchvision==0.16.2 --extra-index-url https://download.pytorch.org/whl/cu121
Error code: 2
Press any key to continue . . .

Additional information

I have a good PC with 64 GB RAM and good internet, it downloads to 2.1 GB in about half an hour. The same problem happened to me a few years back but then I just gave up.

marigoold commented 5 months ago

Maybe you can install torch-2.1.2+cu121 manually, by command pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 --index-url https://download.pytorch.org/whl/cu121.

(And if you are in China, the speed of connecting to this pytorch official website will be slow, you can use tsinghua mirror to download pytorch, by command pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 --index-url https://pypi.tuna.tsinghua.edu.cn/simple)

Madbat1 commented 5 months ago

I'm in Poland. did it and here is the error.

C:\Users\User>pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 --index-url https://download.pytorch.org/whl/cu121 Looking in indexes: https://download.pytorch.org/whl/cu121 Collecting torch==2.1.2 Downloading https://download.pytorch.org/whl/cu121/torch-2.1.2%2Bcu121-cp310-cp310-win_amd64.whl (2473.9 MB) ---------------------------------- ----- 2.2/2.5 GB 1.7 MB/s eta 0:03:10 ERROR: Exception: Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", line 435, in _error_catcher yield File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", line 516, in read data = self._fp.read(amt) if not fp_closed else b"" File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\cachecontrol\filewrapper.py", line 90, in read data = self.__fp.read(amt) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 465, in read s = self.fp.read(amt) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\socket.py", line 705, in readinto return self._sock.recv_into(b) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1274, in recv_into return self.read(nbytes, buffer) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1130, in read return self._sslobj.read(len, buffer) TimeoutError: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\cli\base_command.py", line 167, in exc_logging_wrapper status = run_func(*args) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\cli\req_command.py", line 247, in wrapper return func(self, options, args) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\commands\install.py", line 369, in run requirement_set = resolver.resolve( File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\resolver.py", line 92, in resolve result = self._result = resolver.resolve( File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 481, in resolve state = resolution.resolve(requirements, max_rounds=max_rounds) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 348, in resolve self._add_to_criteria(self.state.criteria, r, parent=None) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 172, in _add_to_criteria if not criterion.candidates: File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\resolvelib\structs.py", line 151, in bool return bool(self._sequence) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 155, in bool return any(self) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 143, in return (c for c in iterator if id(c) not in self._incompatible_ids) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 47, in _iter_built candidate = func() File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\factory.py", line 206, in _make_candidate_from_link self._link_candidate_cache[link] = LinkCandidate( File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 297, in init super().init( File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 162, in init self.dist = self._prepare() File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 231, in _prepare dist = self._prepare_distribution() File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 308, in _prepare_distribution return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\operations\prepare.py", line 438, in prepare_linked_requirement return self._prepare_linked_requirement(req, parallel_builds) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\operations\prepare.py", line 483, in _prepare_linked_requirement local_file = unpack_url( File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\operations\prepare.py", line 165, in unpack_url file = get_http_url( File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\operations\prepare.py", line 106, in get_http_url from_path, content_type = download(link, temp_dir.path) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\network\download.py", line 147, in call for chunk in chunks: File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\cli\progress_bars.py", line 53, in _rich_progress_bar for chunk in iterable: File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\network\utils.py", line 63, in response_chunks for chunk in response.raw.stream( File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", line 573, in stream data = self.read(amt=amt, decode_content=decode_content) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", line 509, in read with self._error_catcher(): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 153, in exit self.gen.throw(typ, value, traceback) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", line 440, in _error_catcher raise ReadTimeoutError(self._pool, None, "Read timed out.") pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='download.pytorch.org', port=443): Read timed out.

[notice] A new release of pip available: 22.2.1 -> 24.0 [notice] To update, run: python.exe -m pip install --upgrade pip

neoligero commented 5 months ago

I'm having the same problem here, Spain. I tried installing torch manually before, but it try to install it anyways.

image

Proof: PS C:\Users\Public\sd.webui> python -c "import torch; print(torch.version)" 2.1.2+cpu

Error: PS C:\Users\Public\sd.webui> .\run.bat Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] Version: v1.9.0 Commit hash: adadb4e3c7382bf3e4f7519126cd6c70f4f8557b Installing torch and torchvision Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu121 Collecting torch==2.1.2 Downloading https://download.pytorch.org/whl/cu121/torch-2.1.2%2Bcu121-cp310-cp310-win_amd64.whl (2473.9 MB) --------------------------------------- 0.1/2.5 GB 1.6 MB/s eta 0:24:56 ERROR: Exception: Traceback (most recent call last): File "C:\Users\Public\sd.webui\system\python\lib\site-packages\pip_vendor\urllib3\response.py", line 438, in _error_catcher yield File "C:\Users\Public\sd.webui\system\python\lib\site-packages\pip_vendor\urllib3\response.py", line 561, in read data = self._fp_read(amt) if not fp_closed else b"" File "C:\Users\Public\sd.webui\system\python\lib\site-packages\pip_vendor\urllib3\response.py", line 527, in _fp_read return self._fp.read(amt) if amt is not None else self._fp.read() File "C:\Users\Public\sd.webui\system\python\lib\site-packages\pip_vendor\cachecontrol\filewrapper.py", line 98, in read data: bytes = self.__fp.read(amt) File "http\client.py", line 465, in read File "socket.py", line 705, in readinto File "ssl.py", line 1274, in recv_into File "ssl.py", line 1130, in read TimeoutError: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Public\sd.webui\system\python\lib\site-packages\pip_internal\cli\base_command.py", line 180, in exc_logging_wrapper status = run_func(*args) ...... etc

hugoserrana commented 5 months ago

The same error happened here. But when I read the installation page again I realized that my version of python is newer than the one supported by pytorch: python 3.10.6.

After creating a virtual environment with the correct version of python everything worked correctly here.

Hope this helps you.

Madbat1 commented 5 months ago

The same error happened here. But when I read the installation page again I realized that my version of python is newer than the one supported by pytorch: python 3.10.6.

After creating a virtual environment with the correct version of python everything worked correctly here.

Hope this helps you.

what version did you use and how to do it?

hugoserrana commented 5 months ago

The python version is 3.10.6 as pointed by README file.

I've created with conda:

conda create -n stable-diffusion-webui python=3.10.6

After this, activate the envinronment:

conda activate stable-diffusion-webui

Run the ./webui.sh script using the created envinronment.

Madbat1 commented 5 months ago

The python version is 3.10.6 as pointed by README file.

I've created with conda:

conda create -n stable-diffusion-webui python=3.10.6

After this, activate the envinronment:

conda activate stable-diffusion-webui

Run the ./webui.sh script using the created envinronment.

I have python version 3.10.6 After downloading conda and writing your code to cmd it give this error 'conda' is not recognized as an internal or external command, operable program or batch file.

marigoold commented 5 months ago

maybe you can try --timeout <sec> param in pip to prevent timeout issues by setting sec to a large value, reference this: https://stackoverflow.com/questions/59796680/disable-pip-install-timeout-for-slow-connections

Madbat1 commented 5 months ago

maybe you can try --timeout <sec> param in pip to prevent timeout issues by setting sec to a large value, reference this: https://stackoverflow.com/questions/59796680/disable-pip-install-timeout-for-slow-connections

try it and it stopped at "2.1/2.5 GB 1.5 MB/s eta 0:03:34" and after some time it give this error

ERROR: Exception: Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", line 435, in _error_catcher yield File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", line 516, in read data = self._fp.read(amt) if not fp_closed else b"" File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\cachecontrol\filewrapper.py", line 90, in read data = self.__fp.read(amt) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 465, in read s = self.fp.read(amt) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\socket.py", line 705, in readinto return self._sock.recv_into(b) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1274, in recv_into return self.read(nbytes, buffer) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1130, in read return self._sslobj.read(len, buffer) TimeoutError: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\cli\base_command.py", line 167, in exc_logging_wrapper status = run_func(*args) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\cli\req_command.py", line 247, in wrapper return func(self, options, args) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\commands\install.py", line 369, in run requirement_set = resolver.resolve( File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\resolver.py", line 92, in resolve result = self._result = resolver.resolve( File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 481, in resolve state = resolution.resolve(requirements, max_rounds=max_rounds) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 348, in resolve self._add_to_criteria(self.state.criteria, r, parent=None) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 172, in _add_to_criteria if not criterion.candidates: File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\resolvelib\structs.py", line 151, in bool return bool(self._sequence) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 155, in bool return any(self) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 143, in return (c for c in iterator if id(c) not in self._incompatible_ids) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 47, in _iter_built candidate = func() File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\factory.py", line 206, in _make_candidate_from_link self._link_candidate_cache[link] = LinkCandidate( File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 297, in init super().init( File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 162, in init self.dist = self._prepare() File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 231, in _prepare dist = self._prepare_distribution() File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 308, in _prepare_distribution return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\operations\prepare.py", line 438, in prepare_linked_requirement return self._prepare_linked_requirement(req, parallel_builds) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\operations\prepare.py", line 483, in _prepare_linked_requirement local_file = unpack_url( File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\operations\prepare.py", line 165, in unpack_url file = get_http_url( File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\operations\prepare.py", line 106, in get_http_url from_path, content_type = download(link, temp_dir.path) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\network\download.py", line 147, in call for chunk in chunks: File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\cli\progress_bars.py", line 53, in _rich_progress_bar for chunk in iterable: File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\network\utils.py", line 63, in response_chunks for chunk in response.raw.stream( File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", line 573, in stream data = self.read(amt=amt, decode_content=decode_content) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", line 509, in read with self._error_catcher(): File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 153, in exit self.gen.throw(typ, value, traceback) File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", line 440, in _error_catcher raise ReadTimeoutError(self._pool, None, "Read timed out.") pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='download.pytorch.org', port=443): Read timed out.

absint93 commented 2 months ago

talvez você possa tentar --timeout <sec>param em pip para evitar problemas de tempo limite definindo sec para um valor alto, consulte isto: https://stackoverflow.com/questions/59796680/disable-pip-install-timeout-for-slow-connections

experimentei e parou em "2.1/2.5 GB 1.5 MB/s eta 0:03:34" e depois de algum tempo deu esse erro

ERRO: Exceção: Traceback (última chamada mais recente): Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", linha 435, em _error_catcher yield Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", linha 516, em dados de leitura = self._fp.read(amt) if not fp_closed else b"" Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_vendor\cachecontrol\filewrapper.py", linha 90, em dados de leitura = self.__fp.read(amt) Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\http\client.py", linha 465, em leitura s = self.fp.read(amt) Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\socket.py", linha 705, em leitura em return self._sock.recv_into(b) Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\ssl.py", linha 1274, em recv_into return self.read(nbytes, buffer) Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\ssl.py", linha 1130, em leitura return self._sslobj.read(len, buffer) TimeoutError: A operação de leitura atingiu o tempo limite

Durante o tratamento da exceção acima, ocorreu outra exceção:

Traceback (última chamada mais recente): Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\cli\base_command.py", linha 167, em exc_logging_wrapper status = run_func(*args) Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\cli\req_command.py", linha 247, em wrapper return func(self, options, args) Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\commands\install.py", linha 369, em run requirement_set = resolver.resolve( Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\resolver.py", linha 92, em resolver result = self._result = resolver.resolve( Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_vendor\resolvelib\resolvers.py", linha 481, em resolver state = resolution.resolve(requirements, max_rounds=max_rounds) Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_vendor\resolvelib\resolvers.py", linha 348, em resolver self._add_to_criteria(self.state.criteria, r, parent=None) Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_vendor\resolvelib\resolvers.py", linha 172, em _add_to_criteria se não for criteria.candidates: Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_vendor\resolvelib\structs.py", linha 151, em bool return bool(self._sequence) Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", linha 155, em bool return any(self) Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", linha 143, em retorno (c para c no iterador se id(c) não estiver em self._incompatible_ids) Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", linha 47, em _iter_built candidate = func() Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\factory.py", linha 206, em _make_candidate_from_link self._link_candidate_cache[link] = LinkCandidate( Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", linha 297, em init super(). init ( Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", linha 162, em init self.dist = self._prepare() Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", linha 231, em _prepare dist = self._prepare_distribution() Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py", linha 308, em _prepare_distribution return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True) Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\operations\prepare.py", linha 438, em prepare_linked_requirement return self._prepare_linked_requirement(req, parallel_builds) Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\operations\prepare.py", linha 483, em _prepare_linked_requirement local_file = unpack_url( Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\operations\prepare.py", linha 165, em unpack_url arquivo = get_http_url( Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\operations\prepare.py", linha 106, em get_http_url from_path, content_type = download(link, temp_dir.path) Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\network\download.py", linha 147, em chamada para bloco em blocos: Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\cli\progress_bars.py", linha 53, em _rich_progress_bar para bloco em iterável: Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_internal\network\utils.py", linha 63, em response_chunks para chunk em response.raw.stream( Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", linha 573, em stream data = self.read(amt=amt, decode_content=decode_content) Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", linha 509, em read com self._error_catcher(): Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\contextlib.py", linha 153, em exit self.gen.throw(typ, value, traceback) Arquivo "C:\Usuários\Usuário\AppData\Local\Programas\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", linha 440, em _error_catcher raise ReadTimeoutError(self._pool, None, "Tempo limite de leitura esgotado.") pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='download.pytorch.org', port=443):Tempo limite de leitura esgotado.

Did you solve it?

LordVVorld commented 1 week ago

I faced the same problem, tried to solve it for a long time, in the end I tried to use VPN for the installation, and to my surprise, it helped.