ImportError: No module named scipy

后端 未结 12 690
悲哀的现实
悲哀的现实 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:18

    For Windows User : pip install -U scipy

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

    if you are using pycharm go to settings and in project interpreter sub-tab click on "+" sign next to list and in the search bar in there search name "scipy" and install the package.

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

    For windows users:

    I found this solution after days. Firstly which python version you want to install?

    If you want for Python 2.7 version:

    STEP 1:

    scipy‑0.19.0‑cp27‑cp27m‑win32.whl

    scipy‑0.19.0‑cp27‑cp27m‑win_amd64.whl

    numpy‑1.11.3+mkl‑cp27‑cp27m‑win32.whl

    numpy‑1.11.3+mkl‑cp27‑cp27m‑win_amd64.whl

    If you want for Python 3.4 version:

    scipy‑0.19.0‑cp34‑cp34m‑win32.whl

    scipy‑0.19.0‑cp34‑cp34m‑win_amd64.whl

    numpy‑1.11.3+mkl‑cp34‑cp34m‑win32.whl

    numpy‑1.11.3+mkl‑cp34‑cp34m‑win_amd64.whl

    If you want for Python 3.5 version:

    scipy‑0.19.0‑cp35‑cp35m‑win32.whl

    scipy‑0.19.0‑cp35‑cp35m‑win_amd64.whl

    numpy‑1.11.3+mkl‑cp35‑cp35m‑win32.whl

    numpy‑1.11.3+mkl‑cp35‑cp35m‑win_amd64.whl

    If you want for Python 3.6 version:

    scipy‑0.19.0‑cp36‑cp36m‑win32.whl

    scipy‑0.19.0‑cp36‑cp36m‑win_amd64.whl

    numpy‑1.11.3+mkl‑cp36‑cp36m‑win32.whl

    numpy‑1.11.3+mkl‑cp36‑cp36m‑win_amd64.whl

    Link: [click[1]

    Once finish installation, go to your directory.

    For example my directory:

    cd C:\Users\asus\AppData\Local\Programs\Python\Python35\Scripts>
    pip install [where/is/your/downloaded/scipy_whl.]
    

    STEP 2:

    Numpy+MKL

    From same web site based on python version again:

    After that use same thing again in Script folder

    cd C:\Users\asus\AppData\Local\Programs\Python\Python35\Scripts>
    pip3 install [where/is/your/downloaded/numpy_whl.]
    

    And test it in python folder.

    Python35>python 
    Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. 
    >>>import scipy
    
    0 讨论(0)
  • 2020-12-05 02:24

    I had a same problem because I installed both of python2.7 and python3. when I run program with python3 I received same error. I install scipy with this command and problem has been solved:

    sudo apt-get install python3-scipy
    
    0 讨论(0)
  • 2020-12-05 02:24

    This may be too basic (and perhaps assumable), but -

    Fedora users can use:

    sudo dnf install python-scipy

    and then (For python3.x):

    pip3 install scipy

    or (For python2.7):

    pip2 install scipy

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

    To ensure easy and correct installation for python use pip from the get go

    To install pip:

    $ wget https://bootstrap.pypa.io/get-pip.py
    $ sudo python2 get-pip.py   # for python 2.7
    $ sudo python3 get-pip.py   # for python 3.x
    

    To install scipy using pip:

    $ pip2 install scipy    # for python 2.7
    $ pip3 install scipy    # for python 3.x
    
    0 讨论(0)
提交回复
热议问题