Even if that is the case, you are still in the wrong place here.
The fail2ban package is provided by your OS vendor and if this one does use python2, then you need to talk to CentOS, Ubuntu, Debian or whatever you are using.
If you are bold, you can try to change the shebang line in the file...