not sure the python modules got built and or installed

I ran makepanda (with python3) which seemed to go okay (but how can I check if the modules were built)

after running the install script this seemed to go okay, but none of the sample seem to work typically with errors like

python3 main.py 
Traceback (most recent call last):
  File "main.py", line 16, in <module>
    from direct.showbase.ShowBase import ShowBase
  File "/usr/local/share/panda3d/direct/showbase/ShowBase.py", line 12, in <module>
    from panda3d.core import *
ImportError: No module named 'panda3d.core'

Void Linux doesn’t have rpm or deb so if the installer has failed, is there a way to manually install the python modules ? how can I verify they have been built?

I could just use the libraries with c++ but it might be nice to be able to throw ideas together quickly with python as its an exceptionally productive language for me…

In order to use Panda in a Python application you need the Panda libs on the LD_LIBRARY_PATH and the Python modules on the PYTHONPATH, which can be done with something like:

export LD_LIBRARY_PATH=/path/to/panda3ddir/built/lib:$LD_LIBRARY_PATH
export PYTHONPATH=/path/to/panda3ddir/built/:$PYTHONPATH

You may also want to have the various Panda programs on your PATH as well:

export PATH=/path/to/panda3ddir//built/bin:$PATH

If you’re using 1.10, which I recommend if you’re using Python3, is to build and install a wheel file. To do this, invoke makepanda with ‘–wheel’. This wheel file (.whl) can be installed by pip into the system Python (not recommended), a user location for Python files by using pip install -U (better), or into a virtualenv (best).

unfortunately that made no difference at all :frowning:

exactly where in the built directory should the modules be, all I ever saw the build process do was build and link libraries or executables…?

There are several possibilities that could be going on:

  • The build process did not complete due to an error.
  • The build process completed, but due to missing development packages, essential components (such as Python support) were not built.
  • The environment was not set up to find the modules appropriately.

If the build succeeded with all the right modules, then you should find at least a built/panda3d/ directory containing a .so file whose name starts with “core”. If it is present, then the PYTHONPATH was not set appropriately to point to the “built” directory. If it is not present, however, then one of the first two conditions must apply.

I would suggest rerunning the makepanda command and paying careful attention to the output. If it mentions warnings about missing modules, make sure that essential modules such as Python are included in the build. If the output does not end in “Build successfully finished.” then there was a build error further up.

nothing in built/panda3d and checking again it says missing python! which has lead me to discover the only python-devel package is 2.7 so something must have changed for the 3+ series… at least I know what the issue is now - thanks!

Surely if the python development includes are missing and you have explicitly asked for the python modules the build process should immediately halt with an error…? just a thought…

Look for a python3-devel package.

yeah I was searching for “python-” packages doh!

anyhow all working now - thanks all