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' 
python your_script.pyandpython3 your_script.pyand see if there's a difference.import picameraanddir(picamera). Thedir()command will show you all the methods and attributes of the module in question. What do you see when you run that in python2.x and python 3.x? Anything resembling "PiCamera"?