I'm using a copy of very simple Pi-3 camera Python app.
import picamera camera = picamera.PiCamera() camera.capture('test.jpg')
If I run those lines in Python 3 (IDLE) console, it works.
If I save the same 3 lines of code in a file and run it, I get:
AttributeError: 'module' object has not attribute 'PiCamera'