C:\Panda3D-1.0.3\samples\Basic-Tutorials–Lesson-1-Scene-Graph>C:\Python23\LIB\o
s.py:282: Warning: ‘yield’ will become a reserved keyword in the future
‘import site’ failed; use -v for traceback
C:\Python23\LIB\os.py:282: Warning: ‘yield’ will become a reserved keyword in th
e future
Traceback (most recent call last):
File “Tut-Step-5-Complete-Solar-System.py”, line 12, in ?
import direct.directbase.DirectStart
File “C:\Panda3D-1.0.3\direct_init_.py”, line 2, in ?
import os,sys
File “C:\Python23\LIB\os.py”, 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:
c:\panda3d-1.0.3\bin\ppython xxxx.py
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
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.
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.
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.
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?
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. #)