Python – problem with installed packages

I'm having a problem with my python installation. The packages that came with the installation work just fine but when I try to use other installed packages I run into problems. For example, I installed a package pymsgbox using pip from an admin shell. When I run a sample script from the command line as in sample, I get

ModuleNotFoundError: No module named 'pymsgbox'

but when I run it by python sample.py it works fine. Likewise if I load it into IDLE and run it from there. Suggestions?