Built from source - cant run examples

Hello !

I built panda from source on my Linux machine using makepanda.py.
I copied the libs to /usr/lib and run ldconfig.
I copied the files in the bin directory to /usr/bin

running ppython ./Tut-Step-1-Blank-Window.py
yields

File “./Tut-Step-1-Blank-Window.py”, line 11, in ?
import direct.directbase.DirectStart
ImportError: No module named direct.directbase.DirectStart

is there anyone who can help me ?
I am not new to programming but new to python and panda.

regards, Oliver

Python is having trouble finding its libraries. It’s also going to have trouble finding its configuration files. These both need to be in their proper places. You have two choices:

Option 1 - put everything in one directory.
Option 2 - arrange everything according to redhat standards.

The easy one is option 1:

mv built /usr/local/panda3d
ln -sf /usr/local/panda3d/bin/* /usr/local/bin
ln -sf /usr/local/panda3d/lib/* /usr/local/lib

The other option takes a lot of steps. If you’re interested in doing it that way, take a look at panda3d.spec, the redhat RPM configuration file. Look at the %install section. That will show you how to arrange the files.

[quote=“Josh Yelon”]
Python is having trouble finding its libraries. It’s also going to have trouble finding its configuration files. These both need to be in their proper places. You have two choices:

Option 1 - put everything in one directory.
Option 2 - arrange everything according to redhat standards.

The easy one is option 1:

mv built /usr/local/panda3d
ln -sf /usr/local/panda3d/bin/* /usr/local/bin
ln -sf /usr/local/panda3d/lib/* /usr/local/lib
[\quote]

I did that but still get
bash-2.05b$ ppython Tut-Step-1-Blank-Window.py
Traceback (most recent call last):
File “Tut-Step-1-Blank-Window.py”, line 11, in ?
import direct.directbase.DirectStart
ImportError: No module named direct.directbase.DirectStart
bash-2.05b$ ls

any idea ?

regards, Oliver

You might need to remove the panda binaries and .so files you already copied into your /usr/bin and /usr/lib directories.

David

Hello !

Thank you both for your help.
Most samples run now, quite nicely !
The picking example doesnt work though. I get :

===============================================
DirectStart: Starting the game.
enumerate is already present in builtin
Warning: DirectNotify: category ‘Interval’ already exists
Known pipe types:
glxGraphicsPipe
(all display modules loaded.)
Traceback (most recent call last):
File “Tut-Chessboard.py”, line 13, in ?
from direct.gui.DirectGUI import *
File “/usr/lib/python2.3/ihooks.py”, line 399, in import_module
m = self.load_tail(q, tail)
File “/usr/lib/python2.3/ihooks.py”, line 452, in load_tail
raise ImportError, "No module named " + mname
ImportError: No module named direct.gui.DirectGUI

and for the Particles tutorial I get :

bash-2.05b$ ppython Tut-Steam-Example.py
DirectStart: Starting the game.
enumerate is already present in builtin
Warning: DirectNotify: category ‘Interval’ already exists
Known pipe types:
glxGraphicsPipe
(all display modules loaded.)
:loader(error): Couldn’t load file models/teapot: not found on model path (which is currently: “.:/etc/…:/etc/…/models”)
Traceback (most recent call last):
File “Tut-Steam-Example.py”, line 126, in ?
w = World()
File “Tut-Steam-Example.py”, line 36, in init
self.t.setPos(0,10,0)
AttributeError: ‘NoneType’ object has no attribute ‘setPos’

regards, Oliver

Hello,
I’m not sure if I should post this here or start a new topic. I’ve just built Panda3D from source on a Mandrake linux computer. Everything seems to be in the right places, but I can’t run the example programs. I can run the first (which only displays a window) but not the others. The window appears, then disappears and I get this error message:

Known pipe types:
glxGraphicsPipe
(all display modules loaded.)
JPEG parameter struct mismatch: library thinks size is 464, caller expects 428

I’m relatively new to python and Panda. What is going wrong here and how do I fix it? Thanks for the help.
Josh

Guest — with regards to this error:

ImportError: No module named direct.gui.DirectGUI

This is a known bug. The correct module name is DirectGui, not DirectGUI. This bug slipped through because windows filenames are not case sensitive, so we didn’t notice. This has been corrected in Panda3D 1.0.4. You don’t need to download 1.0.4, though. It might be quicker to just change the “DirectGUI” to “DirectGui”.

Josh — with regards to this error:

JPEG parameter struct mismatch: library thinks size is 464, caller expects 428

Which sample program were you trying to run, at the time? It sounds like libjpeg is having trouble loading one of our jpg’s. Try viewing the JPG files in an image viewer (like mozilla, for instance). See if they’re corrupted.

I get this same error when I try to run the 3rd, 4th or 5th solar system example program. I can view the images and they seem fine. The 1st and 2nd programs load and do just what the tutorial says they should.
Josh

Not sure what’s going on there.

Is this Mandrake 10.1? I have a spare machine, I could try to install it myself.

Does Mandrake use RPMs?

It is Mandrake 10.1. Mandrake does use RPMs but I did not think the RedHat RPM available for Panda would be compatible so I built it from the source. Thanks.
Josh

You’re right, you can’t use the redhat RPM. But you probably can do this:

rpmbuild -tb panda3d-1.0.4.tar.gz

This will convert the tar-gz file into a binary mandrake RPM. It may work, and it may not. But it’s worth a try.

To me, the error message:

suggests a mismatch between the installed version of libjpeg.so and the version that Panda was compiled against. It’s probably not a problem with any particular jpeg file, but the problem will come up whenever Panda tries to load any jpeg.

I’m not sure how this error happened with a custom-built Panda from source, though. Does the thirdparty library for Linux include libjpeg sources? If it does, perhaps it shouldn’t, since I think the appropriate version of this should be installed on the system by default. If it doesn’t, then Josh, do you have multiple versions of libjpeg installed on your machine?

David

The source distribution for linux doesn’t include libjpeg source.

OK, Josh, I’ve just spend the last four hours trying to get mandrake linux installed, and I’m about to pull my hair out.

The initial setup process went fine. But it appears that it didn’t install half of the development tools — in particular, it didn’t install rpm-build. I see various websites talking about the existence of this package. But the mandrake installation tool doesn’t seem to know about its existence.

There seems to be a tool called the “media manager” which can be configured to download files from various sources. I have a theory that if I were to just provide the right sources, it would be able to find this “rpm-build” package. But I have no idea what source to give it.

So, long story short. You help me get mandrake working, I’ll help you get panda working on mandrake.

  • Josh

Hello,
First I’d like to say thanks for helping me out here and puting forth the effort to install mandrake. Second, I’d like to say sorry about taking so long to get back to you. I tried installing rpmbuild and had to download and install several packages to do that (autoconf, automake etc) but never could quite get rpmbuild to install. I found the rpm but it said it needed automake to install (even though I had installed automake and it seemed to be working :frowning: ). I read David’s post about it seeming to have been compiled against the wrong library, so I reinstalled Mandrake to make sure I had no libjpeg packages (a bit extreme maybe but I had only recently installed it anyway and I had everything backed up) and then reinstalled all of the packages and recompiled. Now, in the last 10 minutes I seem to have gotten all of the examples are working. I’m still not entirely sure what happened but everything seems to be working now. Thanks for all of the help.
Josh[/i]

Hello,
First I’d like to say thanks for helping me out here and puting forth the effort to install mandrake. Second, I’d like to say sorry about taking so long to get back to you. I tried installing rpmbuild and had to download and install several packages to do that (autoconf, automake etc) but never could quite get rpmbuild to install. I found the rpm but it said it needed automake to install (even though I had installed automake and it seemed to be working :frowning: ). I read David’s post about it seeming to have been compiled against the wrong library, so I reinstalled Mandrake to make sure I had no libjpeg packages (a bit extreme maybe but I had only recently installed it anyway and I had everything backed up) and then reinstalled all of the packages and recompiled. Now, in the last 10 minutes I seem to have gotten all of the examples are working. I’m still not entirely sure what happened but everything seems to be working now. Thanks for all of the help.
Josh

Sorry about the double post.
Josh

Did you ever find bison and flex?

If so, where?

I found bison, flex, libjpeg and a couple of other RPMs at www.pbone.net It was a very helpful site.
Josh