Search code examples
pythonfuzzywuzzy

can not import fuzzywuzzy module on jupyter notebook


I am able to import fuzzywuzzy on command promt but not able to import on jupyter notebook

I have even tried assigning sys.executable to my sys.path variable https://stackoverflow.com/a/62419449/8031463

import sys
print(sys.executable)
# sys.path.append(sys.executable)
sys.path = [sys.executable]

now here is the variable values

sys.executable

'c:\python3.6\python.exe'

sys.path

['c:\python3.6\python.exe']

Still i am getting no module error

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-12-e08dc57fd8ae> in <module>
      1 # unique_name_dict
----> 2 from fuzzywuzzy import process
      3 
      4 # word = "anuraag"
      5 

ModuleNotFoundError: No module named 'fuzzywuzzy'

Solution

  • I had 2 paths in system environment, one for python 3.7 and one for 3.6

    My jupyter notebook was running on python 3.7 and pip was installing all the packages to 3.6 by default. I removed 3.6/bin folder from System environment it asked me to install fuzzywuzzy again and it is running perfect now