running the first test program

first i want to say i am a programmer with c++ but found this and wanted to try useing it after several other similar ones did not work at all.

ok after i installed i tried the first saved program it wouldnt work.
i typed in the

import direct.directbase.DirectStart
run()

as the manual stated . saved it and tried running from command prompt. it gives the error:

c:\Panda3D-1.5.4\myprograms>python numberone.py
Traceback (most recent call last):
File “numberone.py”, line 1, in
import direct.directbase.DirectStart
ImportError: No module named direct.directbase.DirectStart

i know the path to python is corredt for some reason i believe its the path to the actual file that is wrong. when i looked at the path it is direct.src.directbase.DirectStart

when i change the path it gives other errors for the next program… do i have to check paths for each individual file and program now? this makes no sense… is it possible that this is an error on the new 1.5.4 update?

No, it really is direct.directbase, without the ‘src’.
It is likely that Panda is simply not in Python’s search path.
You haven’t installed a separate Python besides the one Panda ships with, right?

nope just the one it is packed with and i used PSopad to write the code… the funny thing is the sample programs work just fine when i click on them just absolutely nothing runs when its through command line its wierd… and its definately a location problem it just cant find anything thats called. i checked the programs and they are actually there python just isnt finding them.

Do you have another copy of python installed? Your problem seems like it would be caused by that. If you have another python install you should go to /Lib/site-packages and create a file called panda.pth with the following contents (adjust for installed version):

C://Panda3D-1.5.3
C://Panda3D-1.5.3//bin

Or, just use ‘ppython’.

no i dont have another installed… i even tried uninstalling the newest version and installing 1.5.3 but that didnt help… i will try both your solutions im really wanting to get this running.

thank you i tried absolutely everything i could think of and still kept getting same errors… however typing ppythoin before the program worked !!! thank you so much for all your help

Hi,

I just installed Panda 3D-1.5.4 and tried the sample programs. I received the same errors on 2 samples:

C:\Panda3D-1.5.4\samples\Disco-Lights>python Tut-Disco-Lights.py
Traceback (most recent call last):
File “Tut-Disco-Lights.py”, line 9, in ?
import direct.directbase.DirectStart
ImportError: No module named direct.directbase.DirectStart


Thanks! I’m glad that your solution of typing in ppython instead of python made everything work!