简体   繁体   English

python gdown DistributionNotFound; 文件是exe期间的错误

[英]python gdown DistributionNotFound; Error during file is exe

I get an error when I have the file as an EXE but I get no error when the file is PY.当我将文件作为 EXE 时出现错误,但当文件为 PY 时我没有出现错误。 My code is:我的代码是:

import gdown

url = 'https://drive.google.com/uc?id=18TFG11iQl2de6afdTE9802IHBL7Bq0Tn'
output = 'C:\TakeNotes_Temp\TakeNotes.zip'
gdown.download ( url, output, quiet = False )

This code works perfectly in a PY file but when I use pyinstaller and make it into an EXE I get this error:此代码在 PY 文件中完美运行,但是当我使用 pyinstaller 并将其转换为 EXE 时,我收到此错误: 错误

What can be the problem?可能是什么问题? I executed this command to covert to EXE:我执行了这个命令来转换为 EXE:

pyinstaller --noconfirm --onefile --console --name "test" --log-level "DEBUG" "C:/Desktop/Python/Test.py" pyinstaller --noconfirm --onefile --console --name "test" --log-level "DEBUG" "C:/Desktop/Python/Test.py"

Python version 3.9.1; Python 版本 3.9.1; Pyinstaller version 4.1; Pyinstaller 4.1 版; Pip up to date ( Latest version ). Pip 已更新(最新版本)。

Please do help me!请帮帮我! Any replies will be appreciated!任何回复将不胜感激! Thank you!谢谢!

Problem solved by switching from gdown to Google Drive Downloader:通过从 gdown 切换到 Google Drive Downloader 解决了问题:

from google_drive_downloader import GoogleDriveDownloader as g

g.download_file_from_google_drive ( file_id = '1cqjRLBrgrlSI7KR3VNa64A4l0_TpOB3z', dest_path = 'C:\Desktop\test.zip', unzip = True )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM