首页 > 解决方案 > 尝试从搜索中运行程序时出现“执行脚本失败”错误

问题描述

我用 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

标签: pythonpython-3.xpyinstaller

解决方案


我找到了解决方案。我在代码和 pyinstaller 中尝试了很多东西。这是关于权限的。当我以管理员身份运行时,它起作用了。程序无法在没有管理员权限的情况下打开外部数据库。


推荐阅读