MAINT: fix errors in the scipy detection code when scipy is not installed

I uninstalled scipy to see what would happen when I tried to install algopy, and I found some bugs.