4

I have installed numdifftools and it works in Python shell. But in Spyder, I get this error which don't know how to solve!

ImportError: No module named 'numdifftools'

Tony
  • 9,672
  • 3
  • 47
  • 75
elnaz irannezhad
  • 319
  • 2
  • 3
  • 12

2 Answers2

6

on the IPython console within spyder allows you to use pip. So, in the example, you could do:

[1] !pip install numdifftools

elnaz irannezhad
  • 319
  • 2
  • 3
  • 12
2

All possible answers :

1.For any libraries that you want to add that aren't included in the default search path of spyder (whatever that is) you need to go into Tools and add a path to EACH library via the PYTHONPATH manager. You'll then need to update the module names list from the same menu and restart spyder before the changes take effect.

2.Find the location of a module in Terminal:

$ python  #open python
>>> import numdifftools #import a module
numdifftools #get the location of the package

Copy-paste the module folder to the 'Spyder.app/Contents/Resources/lib/python2.7' Relaunch Spyder.app

3.Try install from ipython(within spyder) : !pip install numdifftools

Refer : similar question

Community
  • 1
  • 1
Ani Menon
  • 27,209
  • 16
  • 105
  • 126
  • Adding the path to the folder containing the module folder to the PYTHONPATHMANAGER under Tools is better as you don't have to repeat with other modules in future . – Kevin Gichia Jan 12 '23 at 15:57