You can import Fermat directly from the folder where you have the repository. For example

       import sys
       from fermat import Fermat

However, if you are working on Ubuntu (or any similar distribution) you can install the Fermat package running the following command in a terminal

python3 build && sudo python3 install