Answer the question
In order to leave comments, you need to log in
The .exe program does not work correctly after pyinstaller. How to find the problem?
Hello!
I wrote a program in pyCharm and it works great when run in pyCharm.
I decided to make an .exe file using pyinstaller , py2exe , auto_py_to_exe , cx_Freeze , I have an .exe file at the output that starts to work correctly, but in the end the program enters the except block. I also tried using other libraries to create .exe, cx_Freeze, auto-py-to-exe
Python 3.6 32-bit
I also created a *.pyc file, and if I run it, everything works fine.
The main code is larger, I will throw off the essence:
Подключаемся к ОРС:
import OpenOPC
opc = OpenOPC.client()
servers = opc.servers()
print(servers)
try:
opc.connect(servers[0])
except:
print("не удалось подключиться к ОРС - серверу")
while:
try:
#обрабатываем полученнные значения
except:
print("error read item")
opc.close()
Answer the question
In order to leave comments, you need to log in
In general, how did you manage to solve the problem.
I created a new project in PyCharm and put there not all my 200 lines of code, but only the minimum necessary to test the program
import OpenOPC
opc = OpenOPC.client()
servers = opc.servers()
print(servers)
try:
opc.connect(servers[0])
except:
print("не удалось подключиться к ОРС - серверу")
while:
try:
#обрабатываем полученнные значения
except:
print("error read item")
opc.close()
Hello, can I have screenshots of the errors?
Because the description of this is good, but in your case it is better to give screenshots.
The first thing that comes to mind until I see an error - and your system is x64 most likely. Maybe the problem lies in the different bitness of Python and OS? Because I don’t remember that pyinstaller had keys for bitness (maybe it’s worth checking).
Try installing x64 Python. Even though it seems like bullshit. Well, of course, screenshots in the studio with errors.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question