Panda Imports Not Working

Basically I tried running a code example from the forums (it was on DistributedSmoothNode)and now none of my imports are working. (ex: from direct.directbase import DirectStart). What do I do and how do I prevent it from happening again? (I reinstalled it also)

Hi. This happened to me. what error message does it give.

Hi, your problem is simply happening because your imports are not correct. Python is case-sensitive, and everything needs to be exact (including CAPS).

#This is the import line you used, which is giving you the error.
from direct.directbase import DirectStart

#This is the correct import line.
import direct.directbase.DirectStart

Your error should be stating that DirectStart is not found, or an incorrect path, something related to that. From this problem, I assume you are somewhat new to Panda3D? If so, you could take a look at my new tutorial series. I made a tutorial series to help beginners and advanced out with Panda3D, and teach them. In my second video, I explain how to use both DirectStart and ShowBase. You can find the series here: Request Topic Deletion

Also, I recommend you use ShowBase instead of DirectStart, since ShowBase is more preferred and DirectStart is literally a small file that imports ShowBase and prints the message “DirectStart: Starting the game.” I highly recommend using ShowBase, since it is the real program that actually creates the display. If you are using DirectStart, then you are using duplicate files that you do not need to. For instance, if you’re using DirectStart, you’re importing 2 files (ShowBase is imported in DirectStart!). However, if you’re using ShowBase, you are creating a display efficiently for the program. I hope this helps!