python - 如何使用easy_install安装panda?

python - 如何使用easy_install安装panda?,第1张

我在Windows 8中使用python 2.7.8,在cmd上我编写了easy_install pandas。经过一些处理后,它给了我一个错误,并让我下载vcpython27。

on cmd:

C:\Python27\Scripts>easy_install.exe pandas
Searching for pandas
Best match: pandas 0.16.2
Processing pandas-0.16.2-py2.7-win32.egg
pandas 0.16.2 is already the active version in easy-install.pth

Using c:\python27\lib\site-packages\pandas-0.16.2-py2.7-win32.egg
Processing dependencies for pandas
Searching for numpy>=1.7.0
Reading https://pypi.python.org/simple/numpy/
Best match: numpy 1.9.2
Downloading https://pypi.python.org/packages/source/n/numpy/numpy-1.9.2.zip#md5=
e80c19d2fb25af576460bb7dac31c59a
Processing numpy-1.9.2.zip
Writing c:\users\dell\appdata\local\temp\easy_install-ifrvr4\numpy-1.9.2\setup.c
fg
Running numpy-1.9.2\setup.py -q bdist_egg --dist-dir c:\users\dell\appdata\local
\temp\easy_install-ifrvr4\numpy-1.9.2\egg-dist-tmp-1tqap5
Running from numpy source directory.
non-existing path in 'numpy\distutils': 'site.cfg'
non-existing path in 'numpy\f2py': 'docs'
non-existing path in 'numpy\f2py': 'f2py.1'
c:\users\dell\appdata\local\temp\easy_install-ifrvr4\numpy-1.9.2\numpy\distutils
\system_info.py:1603: 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__)
c:\users\dell\appdata\local\temp\easy_install-ifrvr4\numpy-1.9.2\numpy\distutils
\system_info.py:1612: UserWarning:
    Blas (http://www.netlib.org/blas/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [blas]) or by setting
    the BLAS environment variable.
  warnings.warn(BlasNotFoundError.__doc__)
c:\users\dell\appdata\local\temp\easy_install-ifrvr4\numpy-1.9.2\numpy\distutils
\system_info.py:1615: UserWarning:
    Blas (http://www.netlib.org/blas/) sources not found.
    Directories to search for the sources can be specified in the
    numpy/distutils/site.cfg file (section [blas_src]) or by setting
    the BLAS_SRC environment variable.
  warnings.warn(BlasSrcNotFoundError.__doc__)
non-existing path in 'numpy\lib': 'benchmarks'
c:\users\dell\appdata\local\temp\easy_install-ifrvr4\numpy-1.9.2\numpy\distutils
\system_info.py:1505: 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__)
c:\users\dell\appdata\local\temp\easy_install-ifrvr4\numpy-1.9.2\numpy\distutils
\system_info.py:1516: 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__)
c:\users\dell\appdata\local\temp\easy_install-ifrvr4\numpy-1.9.2\numpy\distutils
\system_info.py:1519: 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__)
C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option:
 'define_macros'
  warnings.warn(msg)
**error: Setup script exited with error: Microsoft Visual C   9.0 is required (Una
ble to find vcvarsall.bat). Get it from http://aka.ms/vcpython27**

但是在我安装了“vcpython27”后,它给了我:

on cmd:

n function _main
_configtest.exe : fatal error LNK1120: 1 unresolved externals
_configtest.obj : error LNK2019: unresolved external symbol _atanhl referenced i
n function _main
_configtest.exe : fatal error LNK1120: 1 unresolved externals
_configtest.obj : error LNK2019: unresolved external symbol _hypotl referenced i
n function _main
_configtest.exe : fatal error LNK1120: 1 unresolved externals
_configtest.obj : error LNK2019: unresolved external symbol _atan2l referenced i
n function _main
_configtest.exe : fatal error LNK1120: 1 unresolved externals
_configtest.obj : error LNK2019: unresolved external symbol _powl referenced in
function _main
_configtest.exe : fatal error LNK1120: 1 unresolved externals
_configtest.obj : error LNK2019: unresolved external symbol _fmodl referenced in
 function _main
_configtest.exe : fatal error LNK1120: 1 unresolved externals
_configtest.obj : error LNK2019: unresolved external symbol _modfl referenced in
 function _main
_configtest.exe : fatal error LNK1120: 1 unresolved externals
_configtest.obj : error LNK2019: unresolved external symbol _frexpl referenced i
n function _main
_configtest.exe : fatal error LNK1120: 1 unresolved externals
_configtest.obj : error LNK2019: unresolved external symbol _ldexpl referenced i
n function _main
_configtest.exe : fatal error LNK1120: 1 unresolved externals
_configtest.obj : error LNK2019: unresolved external symbol _exp2l referenced in
 function _main
_configtest.exe : fatal error LNK1120: 1 unresolved externals
_configtest.obj : error LNK2019: unresolved external symbol _log2l referenced in
 function _main
_configtest.exe : fatal error LNK1120: 1 unresolved externals
_configtest.obj : error LNK2019: unresolved external symbol _copysignl reference
d in function _main
_configtest.exe : fatal error LNK1120: 1 unresolved externals
_configtest.obj : error LNK2019: unresolved external symbol _nextafterl referenc
ed in function _main
_configtest.exe : fatal error LNK1120: 1 unresolved externals
_configtest.c
_configtest.c(8) : error C2065: 'HAVE_DECL_SIGNBIT' : undeclared identifier
_configtest.c
_configtest.c(8) : error C2065: 'HAVE_DECL_ISFINITE' : undeclared identifier
_configtest.c
_configtest.c(8) : error C2065: 'signbit' : undeclared identifier
_configtest.c
_configtest.c(8) : error C2065: 'isfinite' : undeclared identifier
_configtest.c
_configtest.c(1) : fatal error C1083: Cannot open include file: 'complex.h': No
such file or directory
BUILD_ARCHITECTURE: 'Intel', os.name='nt', sys.platform='win32'
_configtest.c
_configtest.c(3) : error C2054: expected '(' to follow 'inline'
_configtest.c(4) : error C2085: 'static_func' : not in formal parameter list
_configtest.c(4) : error C2143: syntax error : missing ';' before '{'
_configtest.c(7) : error C2054: expected '(' to follow 'inline'
_configtest.c(8) : error C2085: 'nostatic_func' : not in formal parameter list
_configtest.c(8) : error C2143: syntax error : missing ';' before '{'
_configtest.c
_configtest.c(3) : error C2054: expected '(' to follow '__inline__'
_configtest.c(4) : error C2085: 'static_func' : not in formal parameter list
_configtest.c(4) : error C2143: syntax error : missing ';' before '{'
_configtest.c(7) : error C2054: expected '(' to follow '__inline__'
_configtest.c(8) : error C2085: 'nostatic_func' : not in formal parameter list
_configtest.c(8) : error C2143: syntax error : missing ';' before '{'
_configtest.c
_configtest.c(7) : error C2065: 'Py_UNICODE_WIDE' : undeclared identifier
File: build\src.win32-2.7\numpy\core\include/numpy\config.h
#define SIZEOF_PY_INTPTR_T 4
#define SIZEOF_OFF_T 4
#define SIZEOF_PY_LONG_LONG 8
#define MATHLIB
#define HAVE_SIN 1
#define HAVE_COS 1
#define HAVE_TAN 1
#define HAVE_SINH 1
#define HAVE_COSH 1
#define HAVE_TANH 1
#define HAVE_FABS 1
#define HAVE_FLOOR 1
#define HAVE_CEIL 1
#define HAVE_SQRT 1
#define HAVE_LOG10 1
#define HAVE_LOG 1
#define HAVE_EXP 1
#define HAVE_ASIN 1
#define HAVE_ACOS 1
#define HAVE_ATAN 1
#define HAVE_FMOD 1
#define HAVE_MODF 1
#define HAVE_FREXP 1
#define HAVE_LDEXP 1
#define HAVE_ATAN2 1
#define HAVE_POW 1
#define HAVE_XMMINTRIN_H 1
#define HAVE_EMMINTRIN_H 1
#define HAVE__MM_LOAD_PS 1
#define HAVE__MM_LOAD_PD 1
#define HAVE___DECLSPEC_THREAD_ 1
#define __NPY_PRIVATE_NO_SIGNAL
#define FORCE_NO_LONG_DOUBLE_FORMATTING
#define ENABLE_SEPARATE_COMPILATION 1
#define HAVE_LDOUBLE_IEEE_DOUBLE_LE 1
#ifndef __cplusplus
#define inline __inline
#endif

#ifndef _NPY_NPY_CONFIG_H_
#error config.h should never be included directly, include npy_config.h instead
#endif

EOF
_configtest.c
_configtest.c(1) : fatal error C1083: Cannot open include file: 'inttypes.h': No
 such file or directory
_configtest.c
_configtest.c(6) : fatal error C1189: #error :  gcc >= 4 required
File: build\src.win32-2.7\numpy\core\include/numpy\_numpyconfig.h
#define NPY_SIZEOF_SHORT SIZEOF_SHORT
#define NPY_SIZEOF_INT SIZEOF_INT
#define NPY_SIZEOF_LONG SIZEOF_LONG
#define NPY_SIZEOF_FLOAT 4
#define NPY_SIZEOF_COMPLEX_FLOAT 8
#define NPY_SIZEOF_DOUBLE 8
#define NPY_SIZEOF_COMPLEX_DOUBLE 16
#define NPY_SIZEOF_LONGDOUBLE 8
#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 16
#define NPY_SIZEOF_PY_INTPTR_T 4
#define NPY_SIZEOF_OFF_T 4
#define NPY_SIZEOF_PY_LONG_LONG 8
#define NPY_SIZEOF_LONGLONG 8
#define NPY_NO_SIGNAL 1
#define NPY_NO_SMP 0
#define NPY_HAVE_DECL_ISNAN
#define NPY_HAVE_DECL_ISINF
#define NPY_ENABLE_SEPARATE_COMPILATION 1
#define NPY_VISIBILITY_HIDDEN
#define NPY_ABI_VERSION 0x01000009
#define NPY_API_VERSION 0x00000009

#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS 1
#endif

EOF

完全不可理解。有没有解决这个问题的想法?

最佳答案:

1 个答案:

答案 0 :(得分:4)

pandas(以及其他各种python库)使用C语言来执行一些繁重的工作。 Pip包通常在客户端下载和编译C源代码,而在* nix机器上这很好,因为它们通常有一个编译器。但是,Windows并没有附带编译器默认值。所以你的选择是(从最难到最简单):

  1. 安装C编译器(如果你不做任何C则很烦人)
  2. 安装一个类似anaconda或者enthought的python发行版,为你处理这些事情(这些很好很容易,但你可能已经有了一个你想要保留的自定义环境。)
  3. 使用 wheel 安装软件包 - 这些是鸡蛋的后继产品,不需要在窗口上进行编译。有些包装已装有轮子,但不是全部。但是,在http://www.lfd.uci.edu/~gohlke/pythonlibs/处有非正式的车轮收集。您可以下载车轮,并使用pip进行安装。
  4. 编辑:正如@cel - 所建议的那样,为了上帝的缘故,不要使用easy_install使用pip代替 - 许多套餐你需要已经有pip会找到的轮组件。如果你还没有pip,那么试试easy_install pip(就像使用Internet Explorer的唯一原因是使用它来下载另一个浏览器;)

    本文经用户投稿或网站收集转载,如有侵权请联系本站。

发表评论

0条回复