1

I was having an error where any python command sent in the CMD would return a huge string of errors terminating with AttributeError: module 'tokenize' has no attribute 'open'. I could not find a solution anywhere and I resorted to re-install windows as my antivirus was not launching and I thought, "oh great one of those viruses". Long story short it wasn't a virus, just a neglected program that broke and needed repairing, and now it's fine. Unfortunately, python was still buggered. So I uninstalled and reinstalled python. I then went to use pip to download the modules I use. I installed pycolorama just fine, but IMMEDIATELY after installing pyenchant I get the same exact problem. I cant use pip list -v to find where it's installed. Furthermore, I don't understand why a python module would have a file called tokenize when I would assume it is known that python already has a file called tokenize. Any help would be greatly appreciated.

P.S. I am using pyEnchant's spell check to make sure that the user entry is in fact a word in the English dictionary. If there is a better way to do that in the same amount of code:

import enchant
d = enchant.Dict("en_US");
word=input();
if d.check(word) :
          Words.append(word);

then by all means please just say use this module and bugger enchant

Erabior
  • 31
  • 3
  • Which version of `pyenchant` are you using? To find the installation location, you can look at the traceback for the location of the `site-packages` folder – FlyingTeller Jul 24 '21 at 09:14
  • just checked and it seems im using pyenchant verson 3.2.1. in site-packages\enchant\ there is a folder called 'tokenize' the very second I rename that folder to literally anything else python starts working again. Is that going to ruin my scripts that use pyenchant? – Erabior Jul 25 '21 at 15:53
  • If you only rename the folder, then yes, it will break. You will ahve to go one step further and actually change all references to `pyenchant.tokenize` in the source code to whatever you have renamed the folder to – FlyingTeller Jul 26 '21 at 08:40

0 Answers0