Cannot find the 'direct' tree ?

Hi , I am trying to run panda in Gentoo. I emerge it and I am trying to run the GreetingCard. But i get “Cannot find the ‘direct’ tree”. What I am doing wrong?

GreetingCard # ppython GreetingCard.py
Cannot find the 'direct' tree
GreetingCard #

Thanks in advance.

I don’t even know what part of the system might be printing that error message. Can you just run ppython directly? And if that works, can you import direct?

~> ppython
Python 2.2.2 (#1, May 16 2005, 15:19:29)
[GCC 4.0.0 20050512 (Red Hat 4.0.0-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import direct
>>>

Also, can you successfully run pview?


pview

David

I have a similar problem. I can built from source and run the built code without any problem. But when I try to copy the ‘built’ directory someplace else (and adjust the PATH and LD_LIBRARY_PATH appropriately) I get the following:


[malcolmr@buzzer panda3d]$ ppython
Python 2.3.5 (#2, May  4 2005, 08:51:39)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import direct
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "direct/__init__.py", line 7, in ?
    else: exit("Cannot find the 'direct' tree")
TypeError: 'str' object is not callable
>>>

‘pview’ runs fine. And the original of the ‘ppython’ binary in the ‘built’ directory still works okay (even with LD_LIBRARY_PATH pointing at the copy).

Malcolm
[/quote]

Ah, I see what is happening now. This error message is being generated by the direct/init.py file that is generated by makepanda, a tool I am not very familiar with.

If you look at the contents of this file, you will see that it is trying to find the locate the direct/src directory, which it expects to be in the current directory, or in a sibling directory. So the solution is to move the direct/src directory along with your built directory.

David

David is correct. I see now that the documentation is both confusing and partially incorrect. It says:

INSTALLING PANDA

The first step is to copy ‘models’ and ‘samples’ into the built
subdirectory, and ‘direct/src’ into ‘built/direct/src’. Then, move
the built directory anywhere you like on your system. For example,
Linux users might want to move it to /usr/local:

mv built /usr/local/panda3d

That’s not really all that clear, and the bit about models is just wrong. Here’s a better version:

INSTALLING PANDA

The first step is to copy ‘samples’ into the built subdirectory,
and ‘direct/src’ into ‘built/direct/src’. Then, move
the built directory anywhere you like on your system. For example,
Linux users might want to do this:

cp --recursive samples built/samples
cp --recursive direct/src built/direct/src
mv built /usr/local/panda3d

  • Josh

Ah. I really didn’t read this bit closely enough.

Malcolm