I already checked ( in stack exchange and other sites) and googled my problem but all solution seems useless.
Here's the problem :
My computer had win xp and had python2.7 and panda3d (version 1.8.1) installed (python in D: and panda3d in C: ). The module was working perfectly. Unfortunately I had to format my C drive.
I upgraded to win 7 instead of installing xp again after formatting.
Now I had python 2.7 in my D: drive (Which had not been formatted) working perfectly well and only had to install panda in the c: drive at same location again to make my panda files work.
I installed and followed each and every instruction while installing. ( I already had a panda.pth file in my python at my D: drive so no need to make a panda.pth file again). An option came which asked me whether I want to replace existing python and I clicked No as I had done the same the previous time. Now as I had one panda.pth file available in D:/python27 I did not go for creating another and tried to run the following line :
from direct.showbase.ShowBase import ShowBase
Panda3D ships with its own copy of Python 2.7. You can invoke it by running ppython.exe.
You can use a different version of Python, as long as it is the same major version (2.7) and as long as it is the same architecture (should be 32-bit, as Panda3D 1.8.1 is 32-bit). This means putting a panda.pth file in the site-packages directory, containing absolute paths to the root directory and the "bin" directory of your Panda3D installation, each on a separate line.
You could also install Panda3D 1.9.0, which will ask you during the installation whether you'd like to use an existing Python 2.7 installation, if it finds a compatible one already installed.