Installation issues.

Hey guys, I’ve been trying to get this working for a couple of hours now and I’m honestly at my wit’s end :stuck_out_tongue: I’m almost a complete newb to python, but I do have a bit of general Linux experience, as well as bits of C/C++. I’m running Slackware 10.0 with python 2.4.1.

I’ve downloaded panda3d-1.0.4.tar.gz (Linux source code), and I ran makepanda.py in makepanda. After a compile, I set my PATH to build/bin, and my PYTHONPATH to direct/src/showbase. When I try running the first test program, this is what I get (file paths have been reduced to make it a little more readable):

ppython Tut-Step-1-Blank-Window.py
DirectStart: Starting the game.
Traceback (most recent call last):
File “Tut-Step-1-Blank-Window.py”, line 11, in ?
import direct.directbase.DirectStart
File “panda3d-1.0.4/built/direct/…/…/direct/src/directbase/DirectStart.py”, line 3, in ?
from direct.showbase import ShowBase
File “panda3d-1.0.4/built/direct/…/…/direct/src/showbase/ShowBase.py”, line 6, in ?
from pandac.PandaModules import *
ImportError: No module named pandac.PandaModules

This just seems like Python can’t find the proper modules, but I thought I had set the PYTHONPATH correctly.

Any help would be much appreciated…Thanks in advance :smiley:

That’s odd. ‘ppython’ is really just a program that sets ‘PYTHONPATH’ for you (and then it runs python). You shouldn’t have to set PYTHONPATH manually. Somehow, ppython must be blowing it. Try this experiment:

% ppython
Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

import sys
sys.path

It should print out the python path (in a slightly different form). Post the output here. See if it includes your ‘built’ directory. If not, then something’s wrong.

BTW, ‘PYTHONPATH’ should include the ‘built’ directory, not the subdirectory ‘built/direct/src/showbase’. But again, you shouldn’t need to worry about that manually - it should be automatically set for you.

You didn’t modify the compile procedure in any interesting way?

OH! You didn’t move any ‘.so’ files to a different directory, did you? If so, that might cause problems. It uses relative paths to find things.

Ok, I unset PYTHONPATH, then ran ppython

import sys
sys.path
[’’, ‘/home/hydro/user/programming/engines/panda3d-1.0.4/built’, ‘/home/hydro/user/programming/engines/panda3d-1.0.4/built/lib’, ‘/usr/lib/python24.zip’, ‘/usr/lib/python2.4’, ‘/usr/lib/python2.4/plat-linux2’, ‘/usr/lib/python2.4/lib-tk’, ‘/usr/lib/python2.4/lib-dynload’, ‘/usr/lib/python2.4/site-packages’]

I didn’t modify the compile procedure, and I didn’t move any .so files either. In the built/pandac directory though, there’s nothing but a subdir ‘input’. Should there be something else in here? Maybe something’s not being built correctly?

Aha! Yes, thank you for noticing that. Yes, there should be something in there.

Are you sure that ‘makepanda’ completed successfully? Rerun makepanda with the exact same options you did last time. (It won’t recompile anything that it already compiled, so it won’t take long). Keep a close eye out for error messages.

  • Josh

Ah…now something’s happening. I decided to just delete the whole dir and start another compilation from scratch. This time round, it exits with this error message:

…/…/…/built/bin/interrogate: error while loading shared libraries: libpystub.so: cannot open shared object file: No such file or directory

Any ideas? I’m pretty sure this didn’t come up the first time around…quite odd.

OK, that’s interesting.

Makepanda is creating a shared library, libpystub.so, then it’s creating an executable, interrogate, that uses that shared library. Then, it’s trying to run the executable.

In order for this to work, the lib directory containing libpystub.so must be in your shared library path. In theory, makepanda contains code that adds the relevant lib directory to your LD_LIBRARY_PATH. However, it doesn’t appear to be working.

Maybe slackware doesn’t respect the environment variable LD_LIBRARY_PATH?

Or, maybe the code mistakenly believes that the relevant lib directory is already in your library path, so it’s not adding it?

Well, I just exported the LD_LIBRARY_PATH manually to built/lib, and now it can get over that hitch. Maybe it does have something to do with the treatment of certain globals in Slackware? I’m not knowledgable enough about it to comment, and I thought this would be specific to the shell, not to the distribution. I’ll let this compile finish and then tell you how it goes, though…

Ugh…really should sleep though…eh, exams aren’t that important :slight_smile:

Nope, same thing.

ImportError: No module named pandac.PandaModules

These modules still aren’t being built, but I can’t see any error messages. I’m fresh out of ideas…

Thanks for your help so far by the way :slight_smile:

Run makepanda again. It should take no more than one minute, since everything is already built (supposedly). Cut and paste the entire output, start to finish, into this forum.

update — show the ‘makepanda’ command, too.

hydro:[~/user/programming/engines/panda3d-1.0.4]> makepanda/makepanda.py --everything


Makepanda Initial Status Report
Makepanda: Prefix Directory: built
Makepanda: Compiler: LINUXA
Makepanda: Optimize: 3
Makepanda: Keep Pkg: ZLIB PNG JPEG TIFF VRPN FMOD NVIDIACG NSPR SSL FREETYPE FFTW
Makepanda: Omit Pkg: HELIX MILES MAYA5 MAYA6 MAYA65 MAX5 MAX6 MAX7
Makepanda: Thirdparty dir: thirdparty
Makepanda: DirectX SDK dir: None
Makepanda: Verbose vs. Quiet Level: 1
Makepanda: Don’t generate API reference manual
Makepanda: Version ID: 1.0.4
Makepanda: MAYA5 not yet supported under linux
Makepanda: I have automatically added this command-line option: --no-maya5
Makepanda: MAYA6 not yet supported under linux
Makepanda: I have automatically added this command-line option: --no-maya6
Makepanda: MAYA65 not yet supported under linux
Makepanda: I have automatically added this command-line option: --no-maya65
Makepanda: MAX5 not yet supported under linux
Makepanda: I have automatically added this command-line option: --no-max5
Makepanda: MAX6 not yet supported under linux
Makepanda: I have automatically added this command-line option: --no-max6
Makepanda: MAX7 not yet supported under linux
Makepanda: I have automatically added this command-line option: --no-max7
Makepanda: HELIX not yet supported under linux
Makepanda: I have automatically added this command-line option: --no-helix
Makepanda: You do not have a copy of MILES sound system
Makepanda: I have automatically added this command-line option: --no-miles

built/bin/genpycode
enumerate is already present in builtin
hydro:[~/user/programming/engines/panda3d-1.0.4]>

OK, makepanda never finished (it tried to run genpycode and failed).

The good news is that ‘genpycode’ is almost the very last step, so you’re 99% of the way there. The bad news is that I have no idea why genpycode would exit with an error code like that.

In the subdirectory ‘direct/src/ffi’ is a file called “DoGenPyCode.py”. Inside this file, around line 198, you will find this code:

doGetopts()
doErrorCheck()

# Ok, now we can start generating code
from direct.ffi import FFIInterrogateDatabase
db = FFIInterrogateDatabase.FFIInterrogateDatabase(etcPath = etcPath)
db.generateCode(outputDir, extensionsDir)

Go ahead and insert print statements like this:

print "About to doGetopts"
doGetopts()
print "About to doErrorCheck"
doErrorCheck()

# Ok, now we can start generating code
print "About to import FFIID"
from direct.ffi import FFIInterrogateDatabase
print "About to build database"
db = FFIInterrogateDatabase.FFIInterrogateDatabase(etcPath = etcPath)
print "About to generate code"
db.generateCode(outputDir, extensionsDir)

Like that. Then, run ‘makepanda’ again, exactly the same way, and see what it prints out.

built/bin/genpycode
enumerate is already present in builtin
about to do getopts
about to do error check
about to import ffid
panda3d-1.0.4]>

Importing FFID is the last thing it prints, then it just goes back to the prompt. Am I right in guessing it’s not importing the right python modules? Shouldn’t it exit with an error if this were the case?

Yeah, that’s definitely weird. I wonder if your copy of python is corrupted somehow? What version is it?