Samples run but not outside installation directory?

I’m having a somewhat strange issue (on Gentoo) where the sample python scripts run but if I copy and paste their text to a file in my home directory it does not run. Instead in the terminal it says “Hit space to end…” without spawning any window containing a game/demo. Any advice on what’s wrong?

Maybe you forgot to copy files that the samples depend on? Can you paste the error message you got?

Well I don’t get an error exactly, but even if I try a simple program like:

from direct.showbase.ShowBase import ShowBase

p3dApp = ShowBase()
p3dApp.run()

I only get “Hit space to end…” and no window opens but there also isn’t an error (unless I’m missing something, is there a verbose mode?)

Ok nevermind that, now I’m getting actual errors:

That same program yields:

from direct.showbase.ShowBase import ShowBase
ImportError: cannot import name ShowBase

Someone on the IRC channel suggested that this was because an environment variable wasn’t set right. Any info on setting those correctly for Linux?

Ok I seem to have things fixed now, I was using the filename new.py which is apparently something that Panda3d likes to import thus a DLL hell sort of issue