Open nerdnils opened 5 years ago
Hello, Which version of panda are you using? Does this bug also appear when running Demos/B_InputField.py ? I've tried LUI's demo with the latest github's version of panda with python3, but sadly I haven't been able to reproduce this bug.
panda v1.10.0.r48.gcb375f5758-1
Demos/B_InputField.py throws this error:
Traceback (most recent call last):
File "B_InputField.py", line 2, in
This time it looks like the library is not installed. This is strange, because in your first error message python found the library, apparently. Did you switch between python 2 and python 3 in the meantime? (My install is using python 3, but I converted all the files using 2to3, with some light rework, using this script: https://github.com/tobspr/LUI/issues/39 LUI works only with python 2 out of the box.) To install the library system-wide, you can try copying LUI/lui.so ; LUI/Builtin/.py and LUI/Skins to: /usr/lib64/python2.7/site-packages/panda3d/ or LUI/Builtin3/.py etc... to /usr/lib64/python3.7/site-packages/panda3d/ if you use python3. That should at least solve the "No module named 'panda3d.lui'" problem.
Yes, I switched from python2 to python3 but i recompiled lui und put the lui.so into /usr/lib/panda3d/ Let me try to copy it where you suggested and test again.
Update: Nope:
[nils@cab Demos]$ python B_InputField.py
Using deprecated DirectStart interface.
Known pipe types:
glxGraphicsPipe
(all display modules loaded.)
:lui: Loading atlas description from /home/nils/luigit/LUI/Builtin/../Skins/Default/res/atlas.txt
:lui: Loading atlas texture from /home/nils/luigit/LUI/Builtin/../Skins/Default/res/atlas.png
:pnmimage:png(warning): iCCP: known incorrect sRGB profile
:pnmimage:png(warning): iCCP: known incorrect sRGB profile
Traceback (most recent call last):
File "B_InputField.py", line 8, in
LUIBuiltin is in python2, sorry I thought you where talking about your files… converting…
So after converting Builtin:
[nils@cab Demos]$ python B_InputField.py
Traceback (most recent call last):
File "B_InputField.py", line 2, in
I guess at this point I need help again :(
My conversion script actually makes two new folders for the python3 versions of the converted files: Builtin3 Demos3 And it keeps the old folders "Builtin" and "Demos" unchanged. The script makes some changes in the .py sources from the demos, so that they reference the correct version in "Builtin3". In the output you have pasted, they try to include the python2 version in "Builtin", because you ran the demos from the "Demos" directory, which is still in python 2. Sorry, I should have explained this better. Normally if everything is in python3 (panda and LUI), you should be able to run everything using: cd /home/nils/luigit/LUI/Demos3/ python3 ./B_InputField.py
So I converted the demos:
[nils@cab Demos]$ python B_InputField.py
Traceback (most recent call last):
File "B_InputField.py", line 2, in
I was able to reproduce your last error by adding a dot before "DemoFramework" in B_InputField.py L2:
from .DemoFramework import DemoFramework
Then when I run it:
$ python3 ./B_InputField.py
Traceback (most recent call last):
File "./B_InputField.py", line 2, in
The line that is working correctly for me is: from DemoFramework import DemoFramework
What I don't understand: there is no dot upsteam: https://github.com/tobspr/LUI/blob/master/Demos/B_InputField.py So I wonder if you indeed have one in your version of B_InputField.py ?
Another point: perhaps your current python install is configured so that the current path is not searched for modules? You may wish to add the following two lines at the beginning of the Demo3 sources if python3 is unable to find "DemoFramework": import sys sys.path.append('.')
Yes, my Demo-Files and Builtin-Files are full of those dots… after removing them, the Demo seems to work. Only did a very short test for the initial error I posted in this thread.
My original code now throws this:
:lui(error): Atlas 'skin' not found!
Assertion failed: false at line 47 of /home/nils/luigit/LUI/source/./luiAtlasPool.I
Traceback (most recent call last):
File "main.py", line 338, in
Too late for me today to make sense of it.
Should I open another issue or could this be my fault again? Could anybody explain those Atlases to me?
Hello Nils, The general idea of the Atlas is to group many small graphical items into one big image, and have a file describing the position of each item in this big image. The default Atlas for the widgets are in: /home/nils/luigit/LUI/Skins/Default/res/ where the "atlas.png" is the big image, and "atlas.txt" describes each element in the atlas. The Atlas is opened in "LUISkin.py" : L31: skin_location is set, which is the directory where LUI will look for the skins. L51: that is where the skin atlas is actually loaded. My suggestion: perhaps you can replace the relative path L31 by an absolute path, and install the atlas files in /usr/share/LUI/Skins/Default/
So I inserted the Skins-Folder into my gamefolder where the relative path should find it… no change. Changed the path in my gamefolder to an absolute path… no change Changed the path in /usr/lib64/python3.7/site-packages/panda3d/Builtin/LUISkin.py to an absolute path in /usr/lib64/python3.7/site-packages/panda3d/Skins/Default… no change.
It can't be the error that I used /usr/lib64/python3.7/site-packages/panda3d/Skins/Default and not /usr/share/LUI/Skins/Default/… or could it?
PS: How to set if the Builtin from my gamefolder or from /usr/lib64/python3.7/site-packages/panda3d/Builtin is used? But because I changed both it should not matter… The error says it is using "/media/eigene Spiele/exitiers/luibuiltin/LUIFrame.py"… and there was no "/media/eigene Spiele/exitiers/Skins" so that was the first thing I tried… results see above
As long as the path in the source files is consistent with the path where the files actually are, it doesn't really matter where you put them. The advantage of using an absolute path is that the program will run whatever the current working directory may be.
I have a question: do you call LUIDefaultSkin() somewhere?
In DemoFramework.py L56 and L58:
self._skin = LUIDefaultSkin()
self._skin.load()
This does not seem to be the same issue… But I am still trying to get the same game to run again… So at the moment after fixing this I am getting: "free(): invalid pointer Abgebrochen (Speicherabzug geschrieben)" Last line translated meaning "Canceled (memory dump written)" I narrowed it down to this piece of code:
self.mazeSize = LUIRadioboxGroup() self.mazeboxes = [] for i in range(0, 4): print("before radio"+str(i)) radio=LUIRadiobox(group=self.mazeSize, value=i, label=mazetext[i], active=i==0, color=(1,1,1)) print("before if") if i<3: radio.bind("changed",self.changeMazeRadio)
Last thing written before the error comes up is "before radio0". So do you have any idea what could be wrong with the LUIRadiobox here? Thank you a lot this far!
ATM I am recompiling LUI using clean git, your script, move all *3 to original folders 2to3 to build.py and I'll see if that changes anything…
Update: The new one does not have any . at the beginning of the imports. But it makes no difference(I had cleaned the other version). Same error and I can not see any solution for it :( BUT!
This does not seem to be my mistake, same error goes for Demos/B_Radiobox.py: $ python B_Radiobox.py Using deprecated DirectStart interface. Known pipe types: glxGraphicsPipe (all display modules loaded.) :lui: Loading atlas description from /home/nils/luigit/LUI/Builtin/../Skins/Default/res/atlas.txt :lui: Loading atlas texture from /home/nils/luigit/LUI/Builtin/../Skins/Default/res/atlas.png :pnmimage:png(warning): iCCP: known incorrect sRGB profile :pnmimage:png(warning): iCCP: known incorrect sRGB profile munmap_chunk(): invalid pointer Abgebrochen (Speicherabzug geschrieben)
I can see your last error on my system too. I didn't have it last week, so I think this is due to a recent change in panda3d itself. (To make sure it is a change in panda3d I tried B_Radiobox with an elder version of panda 1.10 and the demo still works fine (as it did until today), no surprise here, but I like double-checking everything). I'll investigate this further and keep you informed.
Apparently this is an issue with optional arguments.
In LUIRadiobox.py, when I add an explicit 2nd argument:
self.trigger_event("changed","dummy")
I don't get this segfault. I suspect some changes have been made to interrogate.
I'll investigate further.
I've posted a bug report in panda3d: https://github.com/panda3d/panda3d/issues/542#issue-403466985
The Interrogate bug has been fixed upstream in panda, can you check if you still have errors?
I recompiled panda from (newest)git(-version) but I still got the same error in both programs.
After looking at your error again, I was able to reproduce the "free(): invalid pointer" error, but not the "munmap_chunk(): invalid pointer", so there were many problems, but it is difficult to debug it without the sources. If you want to you can send me your project to: j.stienlet@gmail.com I'll try to have a look at it.
This is the error I get on Keydown:
Traceback (most recent call last): File "luibuiltin/LUIInputField.py", line 139, in on_keydown self.trigger_event("changed", self._value) TypeError: Arguments must match: trigger_event(const LUIBaseElement self, str event_name, unicode message, const LPoint2f coords) trigger_event(const LUIBaseElement self, LUIEventData data)
:util(error): Exception occurred in PythonCallbackObject Traceback (most recent call last): File "luibuiltin/LUIInputField.py", line 105, in on_tick frame_time = globalClock.get_frame_time() - self._tickstart File "luibuiltin/LUIInputField.py", line 139, in on_keydown self.trigger_event("changed", self._value) TypeError: Arguments must match: trigger_event(const LUIBaseElement self, str event_name, unicode message, const LPoint2f coords) trigger_event(const LUIBaseElement self, LUIEventData data)
:util(error): Exception occurred in PythonCallbackObject Traceback (most recent call last): File "/usr/share/panda3d/direct/showbase/ShowBase.py", line 1987, in __igLoop self.graphicsEngine.renderFrame() File "luibuiltin/LUIInputField.py", line 105, in on_tick frame_time = globalClock.get_frame_time() - self._tickstart File "luibuiltin/LUIInputField.py", line 139, in on_keydown self.trigger_event("changed", self._value) TypeError: Arguments must match: trigger_event(const LUIBaseElement self, str event_name, unicode message, const LPoint2f coords) trigger_event(const LUIBaseElement self, LUIEventData data)
:task(error): Exception occurred in PythonTask igLoop Traceback (most recent call last): File "main.py", line 338, in
spiel.run()
File "/usr/share/panda3d/direct/showbase/ShowBase.py", line 3109, in run
self.taskMgr.run()
File "/usr/share/panda3d/direct/task/Task.py", line 531, in run
self.step()
File "/usr/share/panda3d/direct/task/Task.py", line 485, in step
self.mgr.poll()
File "/usr/share/panda3d/direct/showbase/ShowBase.py", line 1987, in __igLoop
self.graphicsEngine.renderFrame()
File "luibuiltin/LUIInputField.py", line 105, in on_tick
frame_time = globalClock.get_frame_time() - self._tickstart
File "luibuiltin/LUIInputField.py", line 139, in on_keydown
self.trigger_event("changed", self._value)
TypeError: Arguments must match:
trigger_event(const LUIBaseElement self, str event_name, unicode message, const LPoint2f coords)
trigger_event(const LUIBaseElement self, LUIEventData data)