Closed FoxKyong closed 6 years ago
Hi,
Not 100% sure, but I suspect the build script is not compatible with Python 3.x (Python 3 support for PyInstaller was only added relatively recently, and I've only ran it with Python 2.7 so I'm not surprised this doesn't work).
I will look into this during the next development iteration (which may take while, but most likely this spring).
As a workaround you could try to build the binaries under Python 2.7.
Thanks for the answer. I managed to compile it using older version of Python. But there is another problem now. Compilation has been done without any errors but if I try to run jpylyzer then I get:
Traceback (most recent call last):
File "jpylyzer/jpylyzer.py", line 43, in <module>
ImportError: No module named config
Failed to execute script jpylyzer
I compiled it as written in BUILD_HOWTO_LINUX with:
pyinstaller --onefile ./jpylyzer/jpylyzer.py
and I used for compilation Python 2.7.9 and 3.5. Both compiled version of jpylyzer do the same error output.
Oops, I'd completely forgotten about the BUILD_HOWTO_LINUX instructions, they're completely out of date (also I was assuming you were trying to build a Debian package, which is obviously not the case!).
Try this instead: go to the root directory of the jpylyzer repo and then run:
./build-with-pyinstaller.sh
Then try to run the jpylyzer binary that is created in the pyi-build/dist directory. I just tried this and it created a fully functional on my machine. Let me know if this doesn't work for you!
I am using Arch linux and openSuse.
I have already tried the script ./build-with-pyinstaller.sh but I got this:
./build-with-pyinstaller.sh: řádek 27: ./pyi-build/dist/jpylyzer: Adresář nebo soubor neexistuje
(folder or file doesn't exist (I use czech language in console)).
Hard to give any advice on this as it looks like some kind of platform-related issue. I don't know if this helps you at all, but one thing you could do is use Vagrant to set up a working virtual environment and use that for the builds. See e.g. the instructions I created here for creating Debian packages in this way:
https://github.com/openpreserve/jpylyzer/tree/master/vagrant
BUT that would result in packages for Ubuntu/Linux Mint, which may not be what you're looking at all?
Do you really need stand-alone binaries in the first place? I.e. your platform already has Python installed on it, so you could just run jpylyzer.py as a Python script?
FWIW one of the things I'll do for the next development cycle is add support for pip install, which should eliminate the need for Linux binaries altogether.
It is easier for my needs to use binary of it. But I have finally manage to run build-with-pyinstaller.sh. I was logged in as root and in the script there is comment that PyInstaller cannot be run as root which I overlooked and the code in if statetment of userid 0 is not working so that is the reason why the script didn't worked as root at all. I have tested the compiled jpylyzer and it works. Thanks for you help. There is just need to fix the if statement in the script if someone is trying to run it as root.
Great to hear it worked in the end. I'll leave the issue open for now just to to remind me of looking at the build script & the outdated instructions.
Updated build script & instructions: https://github.com/openpreserve/jpylyzer/commit/2ffe5a35cf47002d865bcddba6066b0eaa7257d8
Hi, When I try to compile it on linux it fails. On windows it worked but on linux just ends with 'IndexError: tuple index out of range'.