"Failed to execute script" error while try run program from search - python

I created .exe file with PyInstaller. My program works without an error when i run it directly. But when i try to run it from file search it returns "Failed to execute script" error. It doesn't make sense, i do not understand it. Also i can't see any other error -whether console mode or not-
Used imports:
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

I found the solution. I tried a lot of things in code and pyinstaller. It's about permissions. When i run as administrator it worked. Program could not open external the database without administrator perm.

Related

Python msilib for mac

I'm trying to run a python script that has the following import statement:
from ast import keyword
from email.policy import default
from msilib.schema import ComboBox
from statistics import variance
import tkinter as tk
from tkinter import Variable, ttk
from turtle import onclick, width
I get an error on From msilib.schema import Combobox. I'm using a Mac and I see the lib is Microsofts, is there a way I can import a package so that I can use msilib on my Machine.
EDIT: The work around for anyone having the same issue is to run a virtual box with windows. It would still be nice to know how to run it on MAC but oh well...

No module named Linq

I wrote a python script to use in C#, but when I run my project this error occurs: "No module named Linq". what should I do? I took the import part from another part of project from TFS and it works well there, so what is going on?
import System
import clr
import sys
clr.AddReference(''System.Core'')
from System import Array
from System import DateTime
from System.Linq import Enumerable
from System import Func
Check your single vs double quotes.
But try "ImportExtensions"
clr.AddReference("System.Core")
import System
clr.ImportExtensions(System.Linq)

Can't import class and module on Python progrram

I do not program on Python, so I don't know what the problem is.
I just can't start the program from the command line, this is displayed:
Here is code __init__.py
import os
import sys
from PyQt4 import QtGui, QtCore
from pynfb.experiment import Experiment
from pynfb.io.xml_ import xml_file_to_params
from pynfb.settings_widget.general import GeneralSettingsWidget
from pynfb.settings_widget.inlet import InletSettingsWidget
from pynfb.settings_widget.protocol_sequence import ProtocolSequenceSettingsWidget
from pynfb.settings_widget.protocols import ProtocolsSettingsWidget, FileSelectorLine
from pynfb.settings_widget.signals import SignalsSettingsWidget
from pynfb.settings_widget.composite_signals import CompositeSignalsSettingsWidget
from pynfb.settings_widget.protocols_group import ProtocolGroupsSettingsWidget
static_path = os.path.realpath(os.path.dirname(os.path.realpath(__file__)) + '/static')
class SettingsWidget(QtGui.QWidget):
You need to install PyQt4 first: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyqt4.
Download the correct file corresponding to the version of your python, e.g. PyQt4‑4.11.4‑cp37‑cp37m‑win_amd64.whl then install by using pip (https://pip.pypa.io/en/stable/installing/)
pip install PyQt4-4.11.4-cp37-none-win_amd64.whl

CX_Freeze issue after build in use tl.testing?

I am doing a small game in which I use "from tl.testing.thread import ThreadJoiner" to execute threads when executing from console the program as such works but when creating the executable with the help of cx_freeze I have the problem that when executing the program I get an error respect tl tells me that the module tl is not found and the program is not executed.
the error is this:
C:\Users\The.hacker\AppData\Local\Programs\Python\Python36-32\lib\site-packgages\cx_freeze\initscripts\_startup_.py",line 14,in run
module.run()
file:
C:\Users\The.hacker\AppData\Local\Programs\Python\Python36-32\lib\site-packgages\cx_freeze\initscripts\Console.py",line 26,in run
exec(code,m._dict_))
file "the_last_warrior",line 11,in <module>
Modulenotfounderror:no module named tl
on line 11 is the from tl.testing.thread import ThreadJoiner
now the image:
my file main is "the_last_warrior.py"
from tkinter import *
from tkinter import ttk
import tkinter as tk
import tkinter
from tl.testing.thread import ThreadJoiner
import threading
import datetime
from threading import Thread
has more than 1600 lines,In itself, how would the correct import of this module be? (from tl.testing.thread import ThreadJoiner)
picture of error:
console_vs_exe.jpg
After trying many things, I solved by copying the package directly from the folder "Lib \ site-packages" my package "tl" and paste it into the Lib folder of my program already ready after using the setup.py the program executes runs as I expected.

How do i convert a python3.4 script(that has installed modules) into a windows executable using py2exe?

I have a python script that i have to import all these modules, which some of them require downloading:
import datetime
from dateutil import parser
from tkinter import filedialog
import tkinter
import mailbox
import pprint
import json
import urllib.request
from tkinter import *
Is there a way, using py2exe, i can convert the script into a windows executable. If so, how?
To simplify the procedure, you will want to have all your modules already downloaded. This can be accomplished with a simple "pip install " from command prompt. Then it is as simple as writing and running a setup.py file - detailed directions for how to do this can be found here.

Categories

Resources