I'm trying to deploy my Python based application on another Linux host. Pyinstaller works flawlessly as long as I run the generated executable on my own system.
On the target box I get this error message:
/lib/ld-linux-x86-64.so.2: bad ELF
interpreter: No such file or directory
As the output of ldd shows Pyinstaller links my application against /lib/ld-linux-x86-64.so.2 which is only available at /lib64/ld-linux-x86-64.so.2 on the target system (where I only have basic user privileges, so symlinking the file is not an option).
How can I modify my executable to look for the library in /lib64/ instead of /lib/ ?
This is not really a Python question, but a UNIX/Linux compile and link question.
First of all, are you using the latest Pyinstaller. If not, then try that. If you still have the problem, then please report the bug to the Pyinstaller developers here.
Try to workaround your problem by using LD_LIBRARY_PATH to point to the correct directory. For more info read this article
Related
I have an application developed in Kivy which works fine when I execute using a python interpreter. The problem happens when I try to execute after creating an executable using pyinstaller. The .kv file is unable to locate the python modules that it needs. I believe this has something to do with root path configuration of the KV Language but I couldn't find anything to resolve it. "config.py" is the harness/entry file that pyinstaller analyzes. The error occurs in "kv/root_screen.kv" which imports the respective python modules present in "baseclass" folder. Find the screenshot of the error and directory structure below. I have tried executing the files from multiple directories to no effect.
I had the same problem, for me the solution was to fully uninstall all your versions of Python, NOT your code editors, but the Python files.
Usually located in:
C:\Users\YOUR PC NAME\AppData\Local\Programs\Python\Python311
After that go to the official python website:
https://www.python.org/downloads/
And download your preferred version.
In the install click: Add Python... to Path:
https://i.stack.imgur.com/YXYmE.png
Then install your modules using PIP.
I have never made an executable application before but from what I have read its pretty easy, using py2exe to generate the exe.
But I have a GUI that uses Selenium to scrape data from a backend (No I can not use API calls). How do I add chromedriver to the executable? Also, would all the imports go along when using a compiler?
When you compile a .py file into an .exe (from my personal experience) all of the imports are included.
I would personally suggest using pyinstaller. I had quite a few problems using py2exe and as a beginner I found pyinstaller much more user-friendly and easier to troubleshoot.
As compiling a file does not alter the .py file, I would suggest getting it to a fully working state and trying it. If it doesn't appear to work or if some of the imports are lost, we can troubleshoot with the error code.
You can also use cx_Freeze to create an executable from your python script.
You can install cx_Freeze by issuing the command
python -m pip install cx_Freeze --upgrade
in a cmd prompt / terminal.
As far as tkinter is concerned, you'll find a working example of how to freeze a tkinter-based application with the current version of cx_Freeze in this answer. In the setup.py script you find there, you need to replace the name of the Executable by the name of your main script. Place this setup.pyin the same directory than your main script and run
python setup.py build
from a cmd prompt / terminal.
As far as chromedriver is concerned, I've no experience, if you choose this approach and still have problems, please add the exact error message and a Minimal, Complete, and Verifiable example to your question.
We've installed Syntaxhighlighter for MediaWiki on Windows Server 2012 R2 according to the directions here:
https://www.mediawiki.org/wiki/Extension:SyntaxHighlight#Installation
and it is not working. I suspect it has something to do with the line which shows how to make the pygmentize binary executable in Linux, and is completely silent on what needs to be done in a Windows environment. I'm not incredibly familiar with Python, but the environment variable is set and in the command line I can run pygmentize in it's directory if I add the .py extension, but that doesn't fix the issues with Syntaxhighlighter whatsoever. Without the .py extension windows doesn't see it as an executable.
So the question is: what do I do on Windows Server to make pygmentize an executable that can be used by MediaWiki's syntaxhighlighter to effectively highlight syntax?
Or maybe I'm incorrect and that isn't the issue, in which case I welcome any insights!
I am testing the command "productbuild" to archive my application bundle CEMHapp. The idea is to submit the built .pkg file to Mac App Store. At the moment, I am having the following problem:
When I try to run the basic command:
productbuild --component "CEMHapp.app" /Applications CEMHapp.pkg
I get the following error message:
productbuild: error: The component at "CEMHapp.app" is not a bundle.
I also tried the command "pkgbuild", i.e.
pkgbuild --component CEMHapp.app --version 1 --install-location /Applications CEMHapp.pkg
But the following error appears
pkgbuild: Adding component at /Users/wilsondasilva/Desktop/Aplk/CEMHapp.app
pkgbuild: error: Path "/Users/wilsondasilva/Desktop/Aplk/CEMHapp.app" is not a valid bundle component (using destination path "/Users/wilsondasilva/Desktop/Aplk")
The strange thing is that the CEMHapp.app file works runs like a charm, so I do not understand why the system gives me the above presented error. Can anybody shed light on this topic and give me some guidance?
The CEMHapp is a open-source free application that was developed using QtCreator and Python. The bundle (CEMHapp.app) was created using pyinstaller and can be downloaded at http://concrete.fsv.cvut.cz/~wilson/Software/CEMHapp_v.1.0_MacOSX_10.9.2.dmg
Best regards and thanks in advance,
W.
I guess I found a solution for one of the problems, which partially answers my question.
I changed some parts of the command pkgbuild and the CEMHapp.pkg file was successfully created.
Here is the command I used:
pkgbuild --identifier com.CEMHapp.pkg.app --install-location /Applications --root /Users/wilsondasilva/Desktop/Aplk CEMHapp.pkg
after the process is finished, the message in terminal reads
pkgbuild: Wrote package to CEMHapp.pkg
I installed the CEMHapp.pkg and it worked. Nonetheless, the .icns file that was related to the CEMHapp was somehow lost and replaced with the default icon file. Also, a copy of CEMHapp.pkg (with Zero-bytes) appeared in /Applications. Does anybody have a clue on what is wrong?
Furthermore, I still do not know how to use the productbuild properly. Like pkgbuild, it always works when I use the argument --root, but the same is not true when using --component, see error message below:
pkgbuild --identifier com.CEMHapp.pkg.app --install-location /Applications --component /Users/wilsondasilva/Desktop/Aplk CEMHapp.pkg
pkgbuild: Adding component at /Users/wilsondasilva/Desktop/Aplk
pkgbuild: error: Path "/Users/wilsondasilva/Desktop/Aplk" is not a valid bundle component (using destination path "/Users/wilsondasilva/Desktop")
Remember that according to Mac Developer's Library,
"When creating product archives for submission to the Mac App Store, use only the --component mode of productbuild. The other modes will create product archives that are compatible with the OS X Installer, but are not necessarily acceptable for the Mac App Store."
Cheers,
W.
I have a python script that I want to package as a Mac application bundle with py2app. That script calls a CLI executable.
How do I embed that executable in the application bundle?
I tried to edit setup.py in order to include it as a Resource but in that case, execution privileges are lost. Moreover the strip stage of py2app raises an error. I wonder if there is a specific setup.py option that could copy the executable in Content/MacOS instead of Content/Resources.
Adding the CLI executable to the resources it the correct way to do it, but that doesn't work due to a bug in py2app (the file permissions aren't copied at the moment).
The easiest workaround is to reset the file permissions after calling py2app.