It is possible that you have multiple python installations, and the one you execute your script on is different from the one where you installed keras.
Hi, please include the output of the following commands:
pip show keras
python -c "import sys;print(sys.path)"
You said you used pip3 to install keras, then you should do pip3 show keras instead. I note that you are using anaconda and that might be the problem. As you are on Linux there is really no need to use anaconda and it might bring more problems than it solves.