No module named 'fenics' problem for pycharm

I first install python3, then I install fenics via

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:fenics-packages/fenics
sudo apt-get update
sudo apt-get install fenics

then I install pycharm and then I copy an example code and find out that the error No module named ‘fenics’, I have do some research, but none of them solves my problem

This is a pycharm issue, as fenics is installed in at
/usr/lib/petsc/lib/python3/dist-packages/
You need to ensure that this pythonpath is exposed to pycharm.

I’ve based this of:

FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
    apt-get install -y software-properties-common && \
    add-apt-repository ppa:fenics-packages/fenics && \
    apt-get update && \
    apt-get install -y fenics

in which I called

python3 -c "import dolfin; print(dolfin)"
<module 'dolfin' from '/usr/lib/petsc/lib/python3/dist-packages/dolfin/__init__.py'>

I just change the python interpreter to /usr/bin/python3 and it works, I think I install python and fenics with ubuntu with python3, but the interpreter in pycharm is a different one