python - 尝试从搜索中运行程序时出现“执行脚本失败”错误
问题描述
我用 PyInstaller 创建了 .exe 文件。当我直接运行它时,我的程序可以正常工作。但是当我尝试从文件搜索中运行它时,它会返回“无法执行脚本”错误。这没有意义,我不明白。我也看不到任何其他错误-无论是否是控制台模式-
二手进口:
from PyQt5 import QtCore, QtGui, QtWidgets
from course_grabber import getCourseClasses,getCourseCodes
import random
from itertools import combinations
from profilim import Ui_Profilim
from dersler import Ui_dersPlaniPencere
from vt_islemleri import *
from threading import Thread
from webbrowser import open as tarayici_ac
import concurrent.futures
import datetime
import gc
import sys
import sqlite3 as sql
from course import Course
解决方案
我找到了解决方案。我在代码和 pyinstaller 中尝试了很多东西。这是关于权限的。当我以管理员身份运行时,它起作用了。程序无法在没有管理员权限的情况下打开外部数据库。
推荐阅读
- algorithm - What are the algorithms for block finding in graph?
- reactjs - 从子组件更新状态时检查父挂载状态
- php - Artisan serve doesn't work and it deletes server.php
- string - 连接的 Delphi 字符串是否保存在一个隐藏的临时变量中,该变量保留了对该字符串的引用?
- postgresql - Postgres:优化列在字符串中的查询
- winforms - 如何在powershell中添加计时器以在一定时间后退出表单
- python - 如何解压数据框中的列表
- python - Python Pandas OneHotEncoder 类别
- jquery - 为悬停时的 switchClass 创建验证,以便动画与鼠标进入和离开 div 时相关联
- python - 是否可以使用 tensorflow 回调在 tf.keras 模型中记录 epoch 结果,以便在训练结束时保存?