4

I have tried pip install scipy and everything appears fine, going through the path I opened the files and couldn't find any mention of the bootstrap library despite it being on their website: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.bootstrap.html

After looking on Github https://github.com/scipy/scipy/blob/master/scipy/stats/_bootstrap.py I can see there was an update 5 days ago although I last ran the code three days ago with no issues

Error Message

kedoink
  • 81
  • 1
  • 7
  • Are you able to import other things from [`scipy.stats`](https://docs.scipy.org/doc/scipy/reference/stats.html)? Also, what does `pip show scipy` give? – smci Nov 09 '21 at 08:14
  • Yes I am, when I run ```pip show scipy``` it a path going through c:\users\..\local\programs\python\python39\lib\sitepackages do you think it could be pulling from the wrong path? the version is 1.7.2 The github __init__.py file also includes bootstrap which mine does not. Any advice on changing the path? Thanks – kedoink Nov 09 '21 at 09:00
  • Looked through the second path, and it has _bootstrap.py This path is within my user profile as opposed to before that on the C drive, advice on where to go next would be greatly appreciated. (and please lmk about changing/ removing the question, I dont want to lose the little rep I have :) ) – kedoink Nov 09 '21 at 09:05
  • I don't know, try (removing and) installing other versions. Let us know which ones break. – smci Nov 09 '21 at 12:59
  • 1
    You are not using SciPy from source so the updates on GitHub won't take effect until the next release. It looks like the version of SciPy being import in the Jupyter Notebook is different from the one you have locally installed. To check if you have the correct version installed, run the `pip show scipy` (or run `print(scipy.__version__)`) command on your Jupyter Notebook. `bootstrap` has been added in 1.7.0 so you should get a version > 1.7 on your Jupyter Notebook to use the bootstrap function. – Tirth Patel Nov 10 '21 at 12:15

1 Answers1

6

I had this issue and solved it by re-installing the scipy package with pip install -U scipy in order to upgrade to version 1.7

  • 4
    Bot, the answer is sufficient. `bootstrap()` was added to `scipy.stats` in `v1.7`. – eric Jan 11 '22 at 19:25