0

I have just installed scitools-0.8 and I'm trying to import it using from scitools.std import *

but I get an error message saying

ImportError: No module named oldnumeric.mlab

numpy import filed!

see doc of scitools.numpytools module for how to choose Numeric instead.

I don't want to be using Numeric since the book I'm learning from uses numpy and I've read around and it seems that numpy doesn't support oldnumeric any more.

I don't know how to get scitools to work. I am using Python 2.7

There is a similar duplicate to this but the answer it has is basically just don't use scitools

Community
  • 1
  • 1
user3333708
  • 387
  • 1
  • 5
  • 10

1 Answers1

3

The version of scitools you are using is ancient. Try cloning this repo and running [sudo] python setup.py install. The version number is 0.9.0, but some bug fixes have been pushed to the repo since its release. I just did this on Ubuntu 16.04, and running from scitools.std import * seems to work just fine.

By the way, though, the form from XXX import * is generally NOT a good idea, as it pollutes the local namespace and can potentially overwrite other functions. Instead, try from scitools import std or import scitools.std as s so all the functions within that module are in their own namespace.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
  • thanks a lot that worked just fine on Python 2.7, any idea how I can make it work on python 3.5? – user3333708 Jul 03 '16 at 19:49
  • @user3333708 not very easily - you could start by running `2to3` on the source, but likely you'll have to do manual debugging as well. There are a bunch of sneaky differences between 2 and 3 like module name changes, different ways of handling inheritance, `xrange` vs. `range`, `map` becoming a built-in, `raw_input` and `input`, and many more. You might want to file an issue first and see if it's on the maintainer's radar. Good luck! – MattDMo Jul 03 '16 at 20:28
  • Check out [this issue](https://github.com/hplgit/scitools/issues/21) and the associated patch - it may help. – MattDMo Jul 03 '16 at 20:30
  • Get the badge soon ;) – Bhargav Rao Jul 05 '16 at 13:59