Function not implemented error when using PiCamera in python

raspistill -o image.jpeg works just fine so the camera is setup properly. However when I try to programmatically access it, it displays the following error.

python3 -c "from picamera import PiCamera; PiCamera()"
mmal: mmal_component_create_core: could not find component 'vc.camera_info'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/pi/.local/lib/python3.8/site-packages/picamera/camera.py", line 367, in __init__
    with mo.MMALCameraInfo() as camera_info:
  File "/home/pi/.local/lib/python3.8/site-packages/picamera/mmalobj.py", line 2346, in __init__
    super(MMALCameraInfo, self).__init__()
  File "/home/pi/.local/lib/python3.8/site-packages/picamera/mmalobj.py", line 631, in __init__
    mmal_check(
  File "/home/pi/.local/lib/python3.8/site-packages/picamera/exc.py", line 184, in mmal_check
    raise PiCameraMMALError(status, prefix)
picamera.exc.PiCameraMMALError: Failed to create MMAL component b'vc.camera_info': Function not implemented

It is a relatively fresh install. I installed python3, pip3, picamera (using pip) and also install ros2 following their instructions to install on ubuntu mate.

i have the same problem . Did u know the solution of this problem ?

I had this trouble on the 64bit version of Ubuntu mate and it had to do with the libmmal.so files not having the necessary headers(?). I downgraded to 32 bit and copied over a working libmmal.so file from raspbian 32 bit.

I haven't tried copying over from a working 64 bit raspbian.