在PyCharm IDE

时间:2016-11-17 05:31:14

标签: python pandas numpy scipy pycharm

我在PyCharm上全新。

我想执行此代码:

import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler

我收到了这个错误:

 1 import numpy as np
      2 import pandas as pd
----> 3 from sklearn.preprocessing import StandardScaler
C:\Users\...\AppData\Local\Programs\Python\Python35-32\lib\site-packages\sklearn\__init__.py in <module>()
     55 else:
     56     from . import __check_build
---> 57     from .base import clone
     58     __check_build  # avoid flakes unused variable error
     59 
C:\Users\...\AppData\Local\Programs\Python\Python35-32\lib\site-packages\sklearn\base.py in <module>()
      8 
      9 import numpy as np
---> 10 from scipy import sparse
     11 from .externals import six
     12 from .utils.fixes import signature
ImportError: No module named 'scipy'

我还试图在'Project Interpreter'中安装'scipy'软件包,但我在安装软件包时遇到错误。

我成功安装了'numpy','panda'和'sklearn'。

我做错了什么?

编辑:

这是我在安装scipy期间遇到的错误:

Collecting scipy
  Using cached scipy-0.18.1.tar.gz
Installing collected packages: scipy
  Running setup.py install for scipy: started
    Running setup.py install for scipy: finished with status 'error'
    Complete output from command C:\Users\...\AppData\Local\Programs\Python\Python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\...\\AppData\\Local\\Temp\\pycharm-packaging\\scipy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\...\AppData\Local\Temp\pip-uwuiv8a3-record\install-record.txt --single-version-externally-managed --compile:

    Note: if you need reliable uninstall behavior, then install
    with pip instead of using `setup.py install`:

      - `pip install .`       (from a git repo or downloaded source
                               release)
      - `pip install scipy`   (last SciPy release on PyPI)


    lapack_opt_info:
    openblas_lapack_info:
      libraries openblas not found in ['C:\\Users\\...\\AppData\\Local\\Programs\\Python\\Python35-32\\lib', 'C:\\', 'C:\\Users\\...\\AppData\\Local\\Programs\\Python\\Python35-32\\libs']
      NOT AVAILABLE

    lapack_mkl_info:
      libraries mkl_rt not found in ['C:\\Users\\...\\AppData\\Local\\Programs\\Python\\Python35-32\\lib', 'C:\\', 'C:\\Users\\...\\AppData\\Local\\Programs\\Python\\Python35-32\\libs']
      NOT AVAILABLE

    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
    C:\Users\...\AppData\Local\Programs\Python\Python35-32\lib\site-packages\numpy\distutils\system_info.py:639: UserWarning: Specified path C:\projects\numpy-wheels\windows-wheel-builder\atlas-builds\atlas-3.10.1-sse2-32\lib is invalid.
      warnings.warn('Specified path %s is invalid.' % d)
    <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
      NOT AVAILABLE

    atlas_3_10_info:
    <class 'numpy.distutils.system_info.atlas_3_10_info'>
      NOT AVAILABLE

    atlas_threads_info:
    Setting PTATLAS=ATLAS
    <class 'numpy.distutils.system_info.atlas_threads_info'>
      NOT AVAILABLE

    atlas_info:
    <class 'numpy.distutils.system_info.atlas_info'>
      NOT AVAILABLE

    C:\Users\...\AppData\Local\Programs\Python\Python35-32\lib\site-packages\numpy\distutils\system_info.py:1532: UserWarning:
        Atlas (http://math-atlas.sourceforge.net/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [atlas]) or by setting
        the ATLAS environment variable.
      warnings.warn(AtlasNotFoundError.__doc__)
    lapack_info:
      libraries lapack not found in ['C:\\Users\\..\\AppData\\Local\\Programs\\Python\\Python35-32\\lib', 'C:\\', 'C:\\Users\\...\\AppData\\Local\\Programs\\Python\\Python35-32\\libs']
      NOT AVAILABLE

    C:\Users\...\AppData\Local\Programs\Python\Python35-32\lib\site-packages\numpy\distutils\system_info.py:1543: UserWarning:
        Lapack (http://www.netlib.org/lapack/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [lapack]) or by setting
        the LAPACK environment variable.
      warnings.warn(LapackNotFoundError.__doc__)
    lapack_src_info:
      NOT AVAILABLE

    C:\Users\...\AppData\Local\Programs\Python\Python35-32\lib\site-packages\numpy\distutils\system_info.py:1546: UserWarning:
        Lapack (http://www.netlib.org/lapack/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [lapack_src]) or by setting
        the LAPACK_SRC environment variable.
      warnings.warn(LapackSrcNotFoundError.__doc__)
      NOT AVAILABLE

    Running from scipy source directory.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\...\AppData\Local\Temp\pycharm-packaging\scipy\setup.py", line 415, in <module>
        setup_package()
      File "C:\Users\...\AppData\Local\Temp\pycharm-packaging\scipy\setup.py", line 411, in setup_package
        setup(**metadata)
      File "C:\Users\...\AppData\Local\Programs\Python\Python35-32\lib\site-packages\numpy\distutils\core.py", line 135, in setup
        config = configuration()
      File "C:\Users\...\AppData\Local\Temp\pycharm-packaging\scipy\setup.py", line 335, in configuration
        config.add_subpackage('scipy')
      File "C:\Users\...\AppData\Local\Programs\Python\Python35-32\lib\site-packages\numpy\distutils\misc_util.py", line 1000, in add_subpackage
        caller_level = 2)
      File "C:\Users\...\AppData\Local\Programs\Python\Python35-32\lib\site-packages\numpy\distutils\misc_util.py", line 969, in get_subpackage
        caller_level = caller_level + 1)
      File "C:\Users\...\AppData\Local\Programs\Python\Python35-32\lib\site-packages\numpy\distutils\misc_util.py", line 906, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
      File "scipy\setup.py", line 15, in configuration
        config.add_subpackage('linalg')
      File "C:\Users\...\AppData\Local\Programs\Python\Python35-32\lib\site-packages\numpy\distutils\misc_util.py", line 1000, in add_subpackage
        caller_level = 2)
      File "C:\Users\...\AppData\Local\Programs\Python\Python35-32\lib\site-packages\numpy\distutils\misc_util.py", line 969, in get_subpackage
        caller_level = caller_level + 1)
      File "C:\Users\...\AppData\Local\Programs\Python\Python35-32\lib\site-packages\numpy\distutils\misc_util.py", line 906, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
      File "scipy\linalg\setup.py", line 20, in configuration
        raise NotFoundError('no lapack/blas resources found')
    numpy.distutils.system_info.NotFoundError: no lapack/blas resources found

    ----------------------------------------

Command "C:\Users\...\AppData\Local\Programs\Python\Python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\...\\AppData\\Local\\Temp\\pycharm-packaging\\scipy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\...\AppData\Local\Temp\pip-uwuiv8a3-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\...\AppData\Local\Temp\pycharm-packaging\scipy\

0 个答案:

没有答案