BetaRavener / uPyLoader

File transfer and communication tool for MicroPython boards
MIT License
355 stars 76 forks source link

uPyLoader doesn't execute #50

Closed wecr3at3 closed 6 years ago

wecr3at3 commented 6 years ago

undefined symbol: drmGetDevices2

Whenever I try to execute the file after chmod +x uPyLoader-linux using ./uPyLoader-linux, I get the following output - screenshot from 2018-04-24 13-40-04

Please help me out here as I am trying to develop a Curriculum of 21st century skills and I am stuck in my cuz an Editor/IDE is a must for beginners.

BetaRavener commented 6 years ago

Hi, this one is tough to debug. uPyLoader is using Qt for it's GUI and Qt needs to map to some drawing API in operating system. In your case, it seems it's trying to use OpenGL, but it runs into some problem.

I have found multiple discussions in other projects dealing with this issue, e.g. here. It seems like a library (libdrm.so or libdrm.so.2) is packed with the executable and might be causing some problems.

As a first thing you could try is to run from source. If it does work, then the problem could be in mismatch between your operating system and the one that was used to create executable. If you really need an executable even though you can run from source, you could try creating your own (instructions).

PS: I can see that the Linux executable was downloaded numerous times and you're first to report such problem, so it might be problem with configuration of your operating system. Something related to graphics drivers maybe? But be careful playing with those. I would recommend lot of research before changing anything. Another report of this was found here.

vpatron commented 6 years ago

I remember I had similar issues. Several easy ways to make this work right. But the real problem is that the main.py is missing a proper python "shebang" line for Linux. Any of these will fix the issue:

Solution 1:

Solution 2:

#!/usr/bin/env python3

Solution 3:

#!/usr/bin/env bash
python3 main.py

Or if you're using a Python virtual environment like you should, the bash script would be something like:

#!/usr/bin/env bash
source env/bin/activate
python3 main.py
deactivate
BetaRavener commented 6 years ago

What you are describing is running from source. There might be some problems too (I'm not on Linux most of the time so not much testing on my side 😃 ), but the reported problem is tied to executable that was created with PyInstaller. In case you didn't find out yet, you can get the executable from here.

vpatron commented 6 years ago

Oh, I see. I didn't realize PyInstaller can be used to package Linux. Virtualenv might be more reliable for Linux instead of PyInstaller since tons of people use that. Still "running from source" but would package up PyQt, and all modules needed not part of baseline Python3. Linux comes with Python3 anyway, unlike Windows.

linusg commented 6 years ago

Oh, I see. I didn't realize PyInstaller can be used to package Linux.

It can basically create executables for every common and even not so common OS: https://www.pyinstaller.org/

Virtualenv might be more reliable for Linux instead of PyInstaller since tons of people use that.

That's a different thing, you can't "ship" a virtualenv, users still have to manually create it and install the given list of dependencies into it. Basically one can do this already now, it's no difference at all.

vpatron commented 6 years ago

Ah, got it. Thanks linusg.

BetaRavener commented 6 years ago

Closing this as a Pyinstaller issue. Fix doesn't seem to be in near sight, so users experiencing the issue are recommended to run from source or build their own executable.