首页 > 解决方案 > python gdown DistributionNotFound; 文件是exe期间的错误

问题描述

当我将文件作为 EXE 时出现错误,但当文件为 PY 时我没有出现错误。我的代码是:

import gdown

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

此代码在 PY 文件中完美运行,但是当我使用 pyinstaller 并将其转换为 EXE 时,我收到此错误: 错误

可能是什么问题?我执行了这个命令来转换为 EXE:

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

Python 3.9.1 版;Pyinstaller 4.1 版;点到最新(最新版本)。

请帮帮我!任何回复将不胜感激!谢谢!

标签: python

解决方案


通过从 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 )

推荐阅读