I blocked since some hours and i do not know how can i work around.
-I made a python script using jenkinsapi, this is working correctly.
-I´m trying to make a .exe file with py2exe, so I added jenkinsapi in the "includes" as I do usually, it compile correctly.
But when I run the .exe file, I got this error :
import jenkinsapi
File "jenkinsapi__init__.pyc", line 69, in
KeyError: 'jenkinsapi'
Impossible to find the problem, it seems that py2exe didn´t created the .pyd file of jenkinsapi.
Do someone had the same issue and can help me
Related
So, I made a software using python, the GUI is made with pyqt5, after wrapping everything with pyinstaller package i have an executable called Main.exe. When i execute the file normally it works, but i need to execute it with python code. i found this code which is usefull:
import os
os.startfile(r"C:\Users\Desktop\Project\dist\Main\Main.exe")
with other executable it works fine but whenever i try it with my executable 'Main.exe' it doesn't work. where is the problem coming from?
I have developed a simple software in python with GUI. I'm actually working on Natural Language Processing and I've just put the whole NLP process in a GUI.
I tried to convert the whole project to a exe file in python using Pyinstaller. I successfully converted it to an exe file but when I run it , it shows an error message something like this
This is the image of my error
I have already solved it but by using another way of converting py to exe which is the cx_Freeze.
I had the same issue earlier today and finally got it to work using the following software versions:
Python 3.6.8, nltk 3.5 and a dev version of pyinstaller:
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
Additionally, I used scikit-learn version 0.21.1.
Few days back, I had the same problem while compressing to EXE. This Problem generally occurs when PyInstaller failes to find Libraries and Modules to import to the directory. But I overcame this problem and the wise solution yet tedious method to do is mentioned below,
Convert Python Scripts to EXE with console = True in the .spec file or to be simple, do not add --noconsole argument while converting using System Argmuents method.(execute GUI with CMD)
After successfully building the file, go to respective directory (dist folder) and open command prompt
Run the Exe file using Command Prompt.
Find the error message and rectify it correspondingly. For example, consider the following Error Message, vcomp140.dll is missing from \\sklearn\\libs directory.
At the end of this Error Message, you'll find Failed to load dynlib/dll , Therefore, find the file or program which is missing. Say, Here we've .libs\\vcomp140.dll
Find vcomp140.dll using window search bar in your C Drive.
Copy the specific file and paste in the directory(under "dist" folder) where the file is missing. Here, the directory is dist\\PyScriptToEXE\\sklearn\\.libs
MatplotlibDeprecationWarning:
The MATPLOTLIBDATA environment variable was deprecated in Matplotlib 3.1 and will be removed in 3.3.
exec(bytecode, module.__dict__)
Traceback (most recent call last):
...
...
...
py3.7.egg\PyInstaller\loader\pyiboot01_bootstrap.py", line 169, in __init__
__main__.PyInstallerImportError: Failed to load dynlib/dll 'C:\\Users\\MOHAMM~1\\AppData\\Local\\Temp\\_MEI38242\\sklearn\\.libs\\vcomp140.dll'. Most probably this dynlib/dll was not found when the application was frozen.
[13968] Failed to execute script try
Follow the steps again using CMD to eliminate each error.
I'm on day two of a desperate attempt to run a Windows executable from a Python script. This .exe file is opaque to me; in other words, I don't know how to open it up to look at the source code. But importantly, this executable needs to be located in the same directory as a csv file full of parameters in order to work.
When I call the file directly in the command line:
C:\Users\pb\nw_river> Run_Model.exe
the executable works exactly as expected.
However, when I try to call the same file from some python code:
import subprocess
subprocess.Popen(["C:\Users\pb\nw_river\Run_Model.exe"], shell=True)
I receive error messages that indicate that the executable can't "see" the required csv file.
I don't have any of these problems when I run the script on my macbook (MacOS Catalina 10.15.3), but I really need to get this to run on my work computer, which has a Windows 10 Pro OS.
I'm a total noob to Windows. Has anyone ever experienced this issue, and do you have any advice? Thanks in advance!
Hi guys we have an issue while creating the .exe file from the python script, We have issue when we include the sklern and other packages, It's work fine in the pychram but when we try to create the .exe file from the pyinstaller then it creates file but that file did not executed, When we debug the issue we find that its not be able to import the packages, Because each line that import the external package that returns error, If anyone can help us in it that will be great.
I'm trying to convert .py to .exe , but I'm not able to convert it with the help of py2exe in the command line.
I searched on the internet about a py2exe with a GUI frontend and I got the results as:
GUI2EXE (3/5) (The best one I found, but the .exe comes with lots of .dll files and the .exe file is buggy and doesn't work properly.)
H-two-O (2/5) (Waste of time. Doesn't compile any .exe files associated with Tkinter. Very creative and useful for other file formats.)
PytoEXE (1.3/5) (Just as H-two-O , but doesn't compile Tkinter files to .exe)
GP2EXE (?/5) (I didn't try it out. Maybe you can give a view on it.)
PyBuilder (2.7/5) (Reliable, good GUI interface with options but lacks some of the features and compiling speed to that of GUI2EXE.)
PythontoEXE (1.3/5) (Same as PytoEXE)
But these weren't good. I need a compiler better than all of the compilers listed above which can compile Tkinter files to .exe without any bugs.
Here's how I use py2exe. I know this isn't what you're asking for, but according to my experience, it's really annoying until it works. So please hear me out.
Assuming your Python file is called main.py.
New file setup.py (same folder):
from distutils.core import setup
import py2exe
setup(console=['main.py'])
From here, you can create a .bat file in the same folder, or run it from the command line. Either way, you'll be running python setup.py py2exe to compile the code.