python - 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 版;点到最新(最新版本)。
请帮帮我!任何回复将不胜感激!谢谢!
解决方案
通过从 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 )
推荐阅读
- spring-boot - 在 Spring Boot 中使用无默认构造函数和最终字段进行 Bean 初始化
- java - 如何解析输入 JSON,并基于代表产品库存的现有 JSON 生成账单
- html - Buycraft ::从左边保持之前
- windows - Oracle 12c 安装问题
- python - 使用 python 2 和 smtplib 发送电子邮件时出错
- c++ - 将粒子投射到立方体的表面
- html - 添加目录时CSS3按钮动画破坏
- java - 我怎么知道 com.google.firebase.firestore.QuerySnapshot 结束了
- android - Firebase 身份验证返回错误值
- git - 排除 gitignore 中的某些子文件夹以外的所有内容无法正常工作