Using aspect2d in Panda3d-viewer

I am new to Panda3D and am using Panda3D-viewer to render and display a point cloud for a project. I want to have on-screen text to display keyboard shortcuts, but aspect2d stays undefined unless it is in the ShowBase class (according to this discussion: 'aspect2d' is not defined). When trying to put everything into the ShowBase class, my point cloud disappears. How do I use both the ShowBase class and Panda3d Viewer?

Panda3D-viewer is not a development environment. What is proposed to be used in Panda3D-viewer, in fact, you can use directly in the Panda3D application window. The fact that Panda3D-viewer has such features that are listed on the PyPI page actually looks like some kind of misunderstanding.

From a quick look at the documentation, panda3d_viewer is a wrapper around ShowBase. So you should just create the Viewer and not try to create another instance of ShowBase.

You probably need to wait until the viewer has been constructed before you can refer to aspect2d.