gpt4 book ai didi

linux - 为什么错误 urllib.error.ContentTooShortError :

转载 作者:行者123 更新时间:2023-12-04 19:29:20 25 4
gpt4 key购买 nike

检索我用 kivy 编写的程序时出现此错误。
我必须使用 vpn

 Downloading https://dl.google.com/android/repository/android-ndk-r19c-linux-x86_64.zip
Traceback (most recent call last):
File "/home/mm/kivyenv/bin/buildozer", line 8, in <module>
sys.exit(main())
File "/home/mm/kivyenv/lib/python3.8/site-packages/buildozer/scripts/client.py", line 13, in main
Buildozer().run_command(sys.argv[1:])
File "/home/mm/kivyenv/lib/python3.8/site-packages/buildozer/__init__.py", line 1047, in run_command
self.target.run_commands(args)
File "/home/mm/kivyenv/lib/python3.8/site-packages/buildozer/target.py", line 92, in run_commands
func(args)
File "/home/mm/kivyenv/lib/python3.8/site-packages/buildozer/target.py", line 102, in cmd_debug
self.buildozer.prepare_for_build()
File "/home/mm/kivyenv/lib/python3.8/site-packages/buildozer/__init__.py", line 169, in prepare_for_build
self.target.install_platform()
File "/home/mm/kivyenv/lib/python3.8/site-packages/buildozer/targets/android.py", line 665, in install_platform
self._install_android_ndk()
File "/home/mm/kivyenv/lib/python3.8/site-packages/buildozer/targets/android.py", line 455, in _install_android_ndk
self.buildozer.download(url,
File "/home/mm/kivyenv/lib/python3.8/site-packages/buildozer/__init__.py", line 677, in download
urlretrieve(url, filename, report_hook)
File "/usr/lib/python3.8/urllib/request.py", line 1866, in retrieve
raise ContentTooShortError(
urllib.error.ContentTooShortError: <urlopen error retrieval incomplete: got only 261037633 out of 823376982 bytes>

最佳答案

来自 urllib documentation :
异常 urllib.error.ContentTooShortError(msg, content)
当 urlretrieve() 函数检测到下载的数据量小于预期量(由 Content-Length header 给出)时,会引发此异常。 content 属性存储下载的(并且应该被截断的)数据。
实际上,VPN 很可能终止了套接字。您可能需要在程序中实现重试/恢复功能。

关于linux - 为什么错误 urllib.error.ContentTooShortError :,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68161646/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com