I'm running a Python3 program to record a small video on a Raspberry Pi 4B:
` import time
from picamera2 import Picamera2
from picamera2.encoders import H264Encoder
picam2 = Picamera2()
video_config = picam2.create_video_configuration()
picam2.configure(video_config)
encoder = H264Encoder(10000000)
picam2.start_recording(encoder,'/home/pi/test.h264')
time.sleep(10)
picam2.stop_recording()`
When I run this program in VS_Code I receive an error message "no module named picamera2". When I run the same program in Thonny it records a video. Executing import picamera2 in the terminal works also. I like working in VS_Code. Does anyone have an idea why it is reporting an error? Thanks, Jim.