Reputation: 25
I am trying to import an English dictionary into either Spyder or PyCharm to be part of a small batch of code I have written. I have tried three different methods, and, in both PyCharm and Spyder, the needed "modules(?)" fail to import.
Here are the three different methods I tried:
1)
import enchant
d = enchant.Dict("en_US")
2)
import json
collection = json.load(open("collection.json"))
3)
from PyDictionary import PyDictionary
dictionary=PyDictionary()
This is the result I get no matter which method I try and in both PyCharm and Spyder:
ModuleNotFoundError: No module named 'enchant'
Upvotes: 0
Views: 1393
Reputation: 153
Have you made sure to install the enchant lib first:
pip install pyenchant
from a terminal
Then you should be able to just do:import enchant
Upvotes: 1