Error in \direct\showbase\

I get an error when I run the engine, which I have never seen before.

in ShowBase.init(self)

The error is this:
File “c:\DriveSim3\direct\showbase\”, line 351, in init
self.loader = Loader.Loader(self)
File “c:\DriveSim3\direct\showbase\”, line 154, in init
File “c:\DriveSim3\direct\showbase\”, line 179, in _loadPythonFileTypes
for entry_point in pkg_resources.iter_entry_points(‘panda3d.loaders’):
AttributeError: module ‘pkg_resources’ has no attribute ‘iter_entry_points’

The GPU is a NVidia Geforce RTX4080 Super. The OS is Windows11 Home.
I have done a lot of installations of this software but this is the first time I encounter this error. So its something specific for this computer. Could it be related to the display settings? The rendering is on a 7680x1440 desktop, split into 3 channels of 2560x1440 each which has never been a problem before.
Any suggestions are welcome…

I ran the firefly demo in the samples as well, and I got these error messages (same as above):
Known pipe types:
(all display modules loaded.)
Traceback (most recent call last):
File “”, line 420, in
demo = FireflyDemo()
File “”, line 45, in init
File “c:\DriveSim3\direct\showbase\”, line 351, in init
self.loader = Loader.Loader(self)
File “c:\DriveSim3\direct\showbase\”, line 154, in init
File “c:\DriveSim3\direct\showbase\”, line 179, in _loadPythonFileTypes
for entry_point in pkg_resources.iter_entry_points(‘panda3d.loaders’):
AttributeError: module ‘pkg_resources’ has no attribute ‘iter_entry_points’

If needed, I have the detailed output from notify-level-display spam, but I don’t know how to attach that file to this message.

Based on some searching online, it looks like this might be caused by a corrupted installation of setuptools. If feasible, I’d suggest attempting to reinstall that module.

There wasn’t any installation of setup tools, it is simply a copy of a folder with subfolders that contains the \bin, \direct, \etc, \models, \panda3d, \pandac, and \python folders of the original installation.

I’m not suggesting that you installed it–just that it might be already installed on the system in question.

I’d suggest checking–and if it is there, as I said above, attempting to reinstall it.

To clarify, looking around online I’ve seen mention of the exact error that you’re experiencing, found with multiple different applications–but with the answer seeming to come down to setuptools regardless.

Ah, you mean the error may be the result of that there was already a python 3 version installed on the computer and that this conflicts with the python 3.7.9 version located in the \python folder in my installation? I will check with the person responsible for that computer, it is in Chicago, while I am in the Netherlands, which makes this kind of testing a bit difficult. Thank you.

1 Like

A conflict is possible–but it also may be that their installation of it is broken in some way.

But yes, check and get back to us, please!

I checked via teamviewer. It seems there is no version of python installed on that computer. All my software is located in the c:\DriveSim3 folder, where I start python as follows from a batch file:

start /MIN /NORMAL c:\DriveSim3\python\ppython.exe

and that is the version of python (3.7.9) that comes with panda3d. So I don’t think there is a conflict between different python installations.

For safety’s sake, have you checked whether they have setuptools installed? (i.e. Not Python itself, but setuptools specifically.)

I would doubt it, if they don’t have Python installed, but it seems worth checking.

Otherwise, perhaps setuptools is unhappy about something in the environment–but if so, then I don’t know what, I’m afraid.

[edit] Because again, everything that I’m seeing online–granted in only a quick search–is pointing to this being an issue with setuptools.

I think you need to make sure that it is the installed Panda3D that is not working. I guess at the moment you just transferred the contents of the project along with the binaries to another computer. As far as I know, panda has its own add-on on top of Setuptools, perhaps it was lost somehow when transferring the project folder. Installing the SDK is not as easy as it seems, when installing Panda3D, appropriate registry entries are made, including the search paths for binary files.

1 Like

I used this to check if setuptools is installed:
import setuptools
except ImportError:
print(“Not installed.”)

And it printed Installed…

The way I have installed the software at least a honderd times on other computers is by copying a complete folder with all required panda folders with all binaries in it. I never use the panda installer for that. So, for clients I never install the SDK. That always has worked.
However, in order to test if that makes a difference, I just installed the SDK of Panda3D-1.10.12-x64 as well and after that, the error is still the same: it can’t find attributes in pkg_resources.

Well, there we are: setuptools is present after all, and thus might be the source of the problem.

As I said previously, try re-installing it, as the information that I’ve found indicates that the problem might be a broken installation of setuptools.

You were right, there’s something wrong with the installed version of Panda. I installed the SDK of panda 1.10.12-x64 and started the ppython.exe from the \python folder in c:\Panda3D-1.10.12-64\python\ and then the problem was solved. Thank you very much. Maybe something went wrong with the filetransfer, but anyway, it is solved now…

1 Like

Note that Panda3D 1.10.14 no longer errors if pkg_resources is not present, and besides, uses importlib.metadata instead of pkg_resources in Python 3.8 and above.