ImportError: No module named scipy

后端 未结 12 689
悲哀的现实
悲哀的现实 2020-12-05 01:36

I am using Python 2.7 and trying to get PyBrain to work.

But I get this error even though scipy is installed -

Traceback (most recent call last):
           


        
相关标签:
12条回答
  • 2020-12-05 02:02

    Try to install it as a python package using pip as follows

    $ sudo apt-get install python-scipy
    

    If you want to run a python 3.x script, install scipy by:

    $ pip3 install scipy
    Otherwise install it by:
    $ pip install scipy
    
    0 讨论(0)
  • 2020-12-05 02:02

    Your python don't know where you installed scipy. add the scipy path to PYTHONPATH and I hope it will solve your problem.

    0 讨论(0)
  • 2020-12-05 02:08

    I recommend you to remove scipy via

    apt-get purge scipy
    

    and then to install it by

    pip install scipy
    

    If you do both then you might confuse you deb package manager due to possibly differing versions.

    0 讨论(0)
  • 2020-12-05 02:10

    My problem was that I spelt one of the libraries wrongly when installing with pip3, which ended up all the other downloaded libaries in the same command not being installed. Just run pip3 install on them again and they should be installed from their cache.

    0 讨论(0)
  • 2020-12-05 02:13

    If you need to get scipy in your Pyhton environment on Windows you can get the *.whl files here:

    http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy

    Remember that you need to install numpy+mkl before you can install scipy.

    http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

    When you have downloaded the correct *.whl files just open a cmd prompt in the download directory and run pip install *.whl.

    0 讨论(0)
  • 2020-12-05 02:16

    Try to install it as a python package using pip. You said you already tried:

    sudo apt-get install python-scipy
    

    Now run:

    pip install scipy
    

    I ran both and it worked on my Debian-based box.

    0 讨论(0)
提交回复
热议问题