Not working out of box | Syntax Error

C:\Panda3D-1.0.3\samples\Basic-Tutorials–Lesson-1-Scene-Graph>C:\Python23\LIB\o Warning: ‘yield’ will become a reserved keyword in the future
‘import site’ failed; use -v for traceback
C:\Python23\LIB\ Warning: ‘yield’ will become a reserved keyword in th
e future
Traceback (most recent call last):
File “”, line 12, in ?
import direct.directbase.DirectStart
File “C:\Panda3D-1.0.3\”, line 2, in ?
import os,sys
File “C:\Python23\LIB\”, line 282
yield top, dirs, nondirs
SyntaxError: invalid syntax

does not work “out of box”

i’m sure this is just a configuration problem, but i have no experience w/ python. this project has inspired me to learn it… that is… once i get it running.

It looks like you have an install of Python 2.3 on your machine? Panda3d’s binary distribution comes with a version of python, and there is an executable called ‘ppython.exe’ which should be in the bin directory under the directory you installed Panda. This executable will setup all the environment variables needed for Panda3d’s python and call the executable.

Perhaps you tried to run the .py directly? In the samples dir, there are shortcuts to run the examples, and there are the .py files themselves. If you have an install of Python on your box, it’s likely associated with the .py extension, so it will run that if you double-click the .py file.

Try using the shortcut rather than the .py file, or call up a command prompt and go to the directory with the .py file, and try:


Where xxxx is the name of the panda .py file you want to run. Or you could put panda3d’s bin directory in your path before the system’s python directory.


first of all - insanely mad props for the speedy response. you’ve inspired me to register :wink:

seriously. i’ve been checking out some other engines like Ogre3d and Irrlicht. I like Ogre3d because it’s so robust and powerful… but it’s a little complicated. Irrlicht is pretty simple, and the Java port is nice, but the community is more than lacking.

this engine looks amazing. i’ve seen toontown and i’m very excited about this.

anyways, back to the problem.

excellent deduction, i do have an installation of python 2.3 installed. impressive!

i have 2 installations of python (2.3.5 & 2.4). yes, both are neccessary because i have some scripts that only work with one or the other, and i don’t know enough about python to fix them myself.

well, i guess i have 3 installations if you count the one that comes with Panda.

anyways, i’ve tried running the scripts w/ the links provided, manually using panda’s install of python, and using my installation of python… but none worked.

Hello ,

Warning , please be sure to type PPython (p before python)and not python only.

On my system i’ve got python 2.4 and panda .
If i type pyhton, python 2.4 is used
if i type ppython (after setting it in path) panda python is used.

However this is with python 1.01 so maybe i’ll download 1.03 to test the case in newer version.

as i said, the shortcuts provided don’t work, so it’s not a typo. i guess it’s not a big deal anyways, i’d rather write in C++.

When Panda installs, it puts a path variable \bin at the end of the system path string. It is possible that because there is another version of Python on your computer, that it is getting certain libraries like os from the other python directory even though you are using ppython.

Try moving the panda path variable to be before the other python directory.

I can give you steps for Windows XP if you need them.

There must be something like that behind. i’ve got both python2.4 and panda on my computer on win2K and shortcuts provided works perfect.

However in my path , i put python2.4 after panda. both in my administrator variables and system variables.

By the way, works performed on Samples is incredible…(i nearly wished i’ve discovered panda with 1.03 and not with pre release version :slight_smile:))

no need for instructions… just sleep. i have a government final in 6.5 hours. i’ll check it out afterwards and get back to you.

Thank you for your compliment. As the primary programmer on those tutorials it makes me very happy to get positive feedback on them.

Oops, it looks like I wasn’t logged in when I made that last comment. But yeah, feel free to give comments on my samples. Writing code for teaching tends to be somewhat different than writing code for actual use, so if there is anything that needs to be clarified let me know. I already have a couple comments on the collision one that I will be intigrating.


well i took a look, and the other python bins aren’t even in my path variable. regardless, i moved Panda to the front of the list, but to no avail.

Are you still getting the same error message?

I confirm , after upgrading to 1.03 i’ve no issue even with
having both Panda3d and 2.4 python.
I’m on win2K SP4 and i launch PandaDemo from Start Menu .
I can launch them also from command line without error.

Just one question: are you admin on your computer when u install your panda3D?

yes to augur and yes to manake.

for now, i’ve just uninstalled python. it works now so i’m not sure what the deal is. i’ll try to reinstall python later and see if it works.

bottom line (@ least for me) - panda samples work fine when python 2.3.5 is not installed.

i’ve even tried playing around w/ the install options for python. anyways, i had a thought.

for the applications that i’m running which require python (for example, Blender, is it safe/ok for me to just point those applications to the python that comes w/ panda?

(assuming, of course, that they work normally w/ that vers. #)