First you need an English dictionary in Python. I usually use nltk even though there might be better packages. You can install the dictionary of the package by
import nltk
nltk.download('words')
and then a slight adjustment of your code yields what you want:
from nltk.corpus import words
import itertools
# words.words() is list, for faster runtime
word_set = set(words.words())
def anagrams1(word):
letters = list(word.lower())
perms = itertools.permutations(letters)
word_lst = [''.join(p) for p in perms]
ana_lst = set(w for w in word_lst if w in word_set)
return ana_lst
For example,
anagrams1('sink')
>>> {'inks', 'sink', 'skin'}
Edit thanks to Kelly Bundy: A far better runtime can be achieved by a different algorithm, that is checking for every correct word if it is an anagram of the input.
def anagrams2(word):
word_sorted = sorted(word)
ana_lst = set(w for w in words.words() if sorted(w)==word_sorted)
return ana_lst