0

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'
Aniket Tiratkar
  • 798
  • 6
  • 16
omkar
  • 31
  • 7
  • are you able to import in cmd? – Yash Oct 19 '20 at 10:26
  • yes, i am able to import in cmd – omkar Oct 19 '20 at 10:28
  • well seems my sys.path doesn't have any python 3.7 directories (all python 3.6) and i found out my pip installs gets install into "c:\\python3.7\\lib\\site-packages". when i am appending the path to my sys.path i am able to import the module, but problem is how can i change the sys.executable path only? – omkar Oct 19 '20 at 10:31

1 Answers1

0

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

omkar
  • 31
  • 7