I thought I’d try my hand at messing with 3D and downloaded/installed panda v1.6.2 the installation went fine and there were no errors. I can double-click on the shortcuts and the programs will run on my computer, however I can’t seem to run the code in idle.
I tried running the Blank-Window.py sample file in idle and got this error:
Traceback (most recent call last):
File “C:\Python26\Panda3D-1.6.2\samples\Solar-System\Tut-Step-1-Blank-Window.py”, line 11, in
import direct.directbase.DirectStart
ImportError: No module named direct.directbase.DirectStart
Here is the code from the tutorial:
import direct.directbase.DirectStart
run()
I have checked the “Path” setting in Vista, however I don’t think it’s related to that, as it runs fine in a command window, and the shortcut run-links work as well. I just can’t seem to load it, even when I run the tutorial file in its home directory (in the Panda directory).
Any help would be greatly appreciated.
Panda 1.6.2 for windows is built with python 2.5, not 2.6.
Use python2.5 instead, it’s in Panda3D-1.6.2/python/
I’m using a version of wxpython that needs 2.6 I suppose i could change over, but is that really the cause of the import error? I figured it’d have something to do with either idle loading python paths or libraries, but i’m not sure.
is this because panda doesn’t recognize my version of python?
edit: i would lean towards some other explanation, seeing as how the samples run from the command window, just not in the idle shell
You can’t use arbitrary version of python to run panda.
Did you really run the samples from cmd ?
If ran from start menu, then panda’s own python is used by the link.
Hmm, didn’t think it’d be that much of an issue, but ok I’m looking for the python 2.5 version in the panda installation bundle. there is a folder /python and a file python.exe, but i’m not familiar with how to use it.
am i looking in the right place? how can i install the included version of python?
It’s already installed, you just need to use it explicitly.
I’m having the exact same problem, I’d like to know if anyone found a solution to it.
For the record, I am not using the python executable provided with Panda3d, and all hello-world tutorials run from the command prompt, just not from within IDLE.
If it runs from command prompt, it means your default python can find P3D modules.
There is no reason for IDLE to fail, unless you’re using other python version.
Which IDLE version is it ?
Which P3D version is it ?
So here’s what I have:
PATH has Python 2.6 directory, but not Panda3d’s directory.
[size=150]From Command Line[/size]
[color=green]python Tut-Bump-Mapping.py
DirectStart: Starting the game.
Known pipe types:
wglGraphicsPipe
(all display modules loaded.)
Works.
[color=green]“C:\Panda3D-1.7.0\python\python.exe” Tut-Bump-Mapping.py
DirectStart: Starting the game.
Known pipe types:
wglGraphicsPipe
(all display modules loaded.)
Works.
[color=green]“C:\Python26\python.exe” Tut-Bump-Mapping.py
Traceback (most recent call last):
File "Tut-Bump-Mapping.py", line 9, in <module>
from panda3d.core import loadPrcFileData
ImportError: No module named panda3d.core
Fails.
[size=150]From IDLE[/size]
Python 2.6 (r26:66721, Oct 2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
****************************************************************
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
****************************************************************
IDLE 2.6
>>> ================================ RESTART ================================
>>>
Traceback (most recent call last):
File "C:\Panda3D-1.7.0\samples\Bump-Mapping\Tut-Bump-Mapping.py", line 9, in <module>
from panda3d.core import loadPrcFileData
ImportError: No module named panda3d.core
>>>
Fails.
Do you have multiple python installations ?
What if you start the default python from command prompt and post the result of :
import sys
sys.executable
that’s weird, it’s still defaulting to Panda3d’s python… how do I fix this?! I didn’t see it in PATH.
I don’t know what’s wrong with your PATH, but definitely python26 can’t find your P3D installation.
Just create a file in your Python26/Lib/site-packages, name it anythingyoulike.pth, and put your P3D installation directory in it.
Thanks for the help, I put the .pth file in the wrong folder and I guess that was one of the reasons.
However I’m still not out of the woods yet:
Traceback (most recent call last):
File "C:\Panda3D-1.7.0\samples\Bump-Mapping\Tut-Bump-Mapping.py", line 9, in <module>
from panda3d.core import loadPrcFileData
File "C:\Panda3D-1.7.0\panda3d.py", line 190, in __getattr__
mod = self.__manager__.libimport(lib)
File "C:\Panda3D-1.7.0\panda3d.py", line 122, in libimport
raise ImportError, message
ImportError: DLL loader cannot find libpandaexpress.
My .pth file contains:
C:\Panda3D-1.7.0
C:\Panda3D
It should contain the root and /bin. IIRC it’s already mentioned in the troubleshooting section of the manual.
Awesome!
I guess the big stumbling block was the .pth file location, but either way now there’s a thread in the forum with the complete answer 
Thanks!