ImportError: Cannot find libpandaexpress.dll

I’m new to Panda3D, but I’ve had a bit of a look through the initial tutorial in the manual to get me started.
I’m trying to run the following code, but I’m getting an error saying it can’t find libpandaexpress.dll. I’ve checked and it’s in the bin folder, and my panda.pth file shows

..
../bin

so it should work. I was previously getting a DLL load failed error, which I believed was down to using 64-bit Panda3D on 32-bit Python. I installed the 32-bit Panda3D, and now I’m getting this error! I’m now using 32-bit Panda3D on 32-bit Python 2.7 (using Spyder and the IPython console), on a 64-bit Windows 7 PC. Has anyone got any ideas what’s wrong?

Code

from direct.showbase.ShowBase import ShowBase

class MyApp(ShowBase):
    
    def __init__(self):
        ShowBase.__init__(self)
        
        """
        # Load the environment model.
        self.scene = self.loader.loadModel("models/environment")
        # Reparent the model to render.
        self.scene.reparentTo(self.render)
        # Apply scale and position transforms on the model.
        self.scene.setScale(0.25, 0.25, 0.25)
        self.scene.setPos(-8, 42, 0)
        """        
        
        # Load and render the buildings
        self.buildings = self.loader.loadModel("models/project/newcastle2.egg")
        self.buildings.reparentTo(self.render)
        self.buildings.setPos(-424950, -564.525, -80)        

app = MyApp()
app.run()

Traceback

Traceback (most recent call last):

  File "<ipython-input-37-b458979193cc>", line 1, in <module>
    runfile('H:/Research_Scholarship/Panda3D-1.9.4/project.py', wdir='H:/Research_Scholarship/Panda3D-1.9.4')

  File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile
    execfile(filename, namespace)

  File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 71, in execfile
    exec(compile(scripttext, filename, 'exec'), glob, loc)

  File "H:/Research_Scholarship/Panda3D-1.9.4/project.py", line 17, in <module>
    from direct.showbase.ShowBase import ShowBase

  File "direct\showbase\ShowBase.py", line 30, in <module>
    from direct.interval import IntervalManager

  File "direct\interval\IntervalManager.py", line 5, in <module>
    from pandac.PandaModules import *

  File "pandac\PandaModules.py", line 2, in <module>
    from panda3dCoreModules import *

  File "pandac\panda3dCoreModules.py", line 1, in <module>
    from extension_native_helpers import *

  File "pandac\extension_native_helpers.py", line 66, in <module>
    raise ImportError(message)

ImportError: Cannot find libpandaexpress.dll

The SDK installers for Windows ship with their own copy of Python (ppython) that has Panda3D installed. In other words, Panda3D does not install to your system Python on Windows. The simplest way to install Panda3D into your system Python is via pip (pip install panda3d). The other option you have is to try and get Spyder and IPython working with Panda3D’s ppython instead of your system Python.

I’ve just tried to install pip, using the get-pip.py file from https://bootstrap.pypa.io/get-pip.py, however I’m getting more errors:

runfile('//campus/home/Home2015/b5027438/Downloads/get-pip.py', wdir='//campus/home/Home2015/b5027438/Downloads')
Traceback (most recent call last):

  File "<ipython-input-9-7618abf695b4>", line 1, in <module>
    runfile('//campus/home/Home2015/b5027438/Downloads/get-pip.py', wdir='//campus/home/Home2015/b5027438/Downloads')

  File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile
    execfile(filename, namespace)

  File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 71, in execfile
    exec(compile(scripttext, filename, 'exec'), glob, loc)

  File "//campus/home/Home2015/b5027438/Downloads/get-pip.py", line 20061, in <module>
    main()

  File "//campus/home/Home2015/b5027438/Downloads/get-pip.py", line 194, in main
    bootstrap(tmpdir=tmpdir)

  File "//campus/home/Home2015/b5027438/Downloads/get-pip.py", line 172, in bootstrap
    sys.exit(pip.main(["install", "--upgrade"] + args))

  File "C:\Python27\lib\site-packages\pip\__init__.py", line 217, in main
    return command.main(cmd_args)

  File "C:\Python27\lib\site-packages\pip\basecommand.py", line 185, in main
    for name in ["pip._vendor", "distlib", "requests", "urllib3"]

  File "C:\Python27\lib\logging\config.py", line 794, in dictConfig
    dictConfigClass(config).configure()

  File "C:\Python27\lib\logging\config.py", line 576, in configure
    '%r: %s' % (name, e))

ValueError: Unable to configure handler 'console': 'OutStream' object has no attribute 'closed'

I do not quite understand how you got this problem. Do you run a demo?

You also can run this method, just specify where the python in the panda.

file: run.bat

D:\Panda3D-1.9.4-x64\python\python.exe main.py
pause