2016-08-20 59 views
1

我試圖使用PIP到本地文件夾升級SciPy的在Redhat 6.7升級SciPy的:在redhat

pip install --user --upgrade scipy 

但是,下面的錯誤彈出:

You are using pip version 7.1.0, however version 8.1.2 is available. 
You should consider upgrading via the 'pip install --upgrade pip' command. 
Collecting scipy 
Using cached scipy-0.18.0.tar.gz 
Installing collected packages: scipy 
Running setup.py install for scipy 
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-i0GYOd/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-aq6BzP-record/install-record.txt --single-version-externally-managed --compile --user --prefix=: 

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: 
lapack_mkl_info: 
mkl_info: 
libraries mkl,vml,guide not found in /usr/local/lib64 
libraries mkl,vml,guide not found in /usr/local/lib 
libraries mkl,vml,guide not found in /usr/lib64 
libraries mkl,vml,guide not found in /usr/lib 
NOT AVAILABLE 

NOT AVAILABLE 

atlas_threads_info: 
Setting PTATLAS=ATLAS 
libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib64 
libraries lapack_atlas not found in /usr/local/lib64 
libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib 
libraries lapack_atlas not found in /usr/local/lib 
libraries lapack_atlas not found in /usr/lib64/atlas 
numpy.distutils.system_info.atlas_threads_info 
Setting PTATLAS=ATLAS 
Setting PTATLAS=ATLAS 
FOUND: 
    libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas'] 
    library_dirs = ['/usr/lib64/atlas'] 
    language = f77 
    include_dirs = ['/usr/include'] 

/usr/lib64/python2.6/site-packages/numpy/distutils/command/config.py:394: DeprecationWarning: 
+++++++++++++++++++++++++++++++++++++++++++++++++ 
Usage of get_output is deprecated: please do not 
use it anymore, and avoid configuration checks 
involving running executable on the target machine. 
+++++++++++++++++++++++++++++++++++++++++++++++++ 

DeprecationWarning) 
customize GnuFCompiler 
Found executable /usr/bin/g77 
gnu: no Fortran 90 compiler found 
gnu: no Fortran 90 compiler found 
customize GnuFCompiler 
gnu: no Fortran 90 compiler found 
gnu: no Fortran 90 compiler found 
customize GnuFCompiler using config 
compiling '_configtest.c': 

/* This file is generated from numpy/distutils/system_info.py */ 
void ATL_buildinfo(void); 
int main(void) { 
ATL_buildinfo(); 
return 0; 
} 
C compiler: gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC 

compile options: '-c' 
gcc: _configtest.c 
gcc -pthread _configtest.o -L/usr/lib64/atlas -llapack -lptf77blas -lptcblas -latlas -o _configtest 
ATLAS version 3.8.4 built by mockbuild on Thu Feb 9 08:22:21 EST 2012: 
UNAME : Linux x86-010.build.bos.redhat.com 2.6.18-274.17.1.el5 #1 SMP Wed Jan 4 22:45:44 EST 2012 x86_64 x86_64 x86_64 GNU/Linux 
INSTFLG : -1 0 -a 1 
ARCHDEFS : -DATL_OS_Linux -DATL_ARCH_P4E -DATL_CPUMHZ=3600 -DATL_SSE2 -DATL_SSE1 -DATL_USE64BITS -DATL_GAS_x8664 
F2CDEFS : -DAdd_ -DF77_INTEGER=int -DStringSunStyle 
CACHEEDGE: 524288 
F77  : gfortran, version GNU Fortran (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) 
F77FLAGS : -fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -g -Wa,--noexecstack -fPIC -m64 
SMC  : gcc, version gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) 
SMCFLAGS : -fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -g -Wa,--noexecstack -fPIC -m64 
SKC  : gcc, version gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3) 
SKCFLAGS : -fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -g -Wa,--noexecstack -fPIC -m64 
success! 
removing: _configtest.c _configtest.o _configtest 
FOUND: 
    libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas'] 
    library_dirs = ['/usr/lib64/atlas'] 
    language = f77 
    define_macros = [('ATLAS_INFO', '"\\"3.8.4\\""')] 
    include_dirs = ['/usr/include'] 

Traceback (most recent call last): 
File "<string>", line 1, in <module> 
File "/tmp/pip-build-i0GYOd/scipy/setup.py", line 415, in <module> 
    setup_package() 
File "/tmp/pip-build-i0GYOd/scipy/setup.py", line 411, in setup_package 
    setup(**metadata) 
File "/usr/lib64/python2.6/site-packages/numpy/distutils/core.py", line 152, in setup 
    config = configuration() 
File "/tmp/pip-build-i0GYOd/scipy/setup.py", line 335, in configuration 
    config.add_subpackage('scipy') 
File "/usr/lib64/python2.6/site-packages/numpy/distutils/misc_util.py", line 957, in add_subpackage 
    caller_level = 2) 
File "/usr/lib64/python2.6/site-packages/numpy/distutils/misc_util.py", line 926, in get_subpackage 
    caller_level = caller_level + 1) 
File "/usr/lib64/python2.6/site-packages/numpy/distutils/misc_util.py", line 863, in _get_configuration_from_setup_py 
    config = setup_module.configuration(*args) 
File "scipy/setup.py", line 9, in configuration 
    config.add_subpackage('cluster') 
File "/usr/lib64/python2.6/site-packages/numpy/distutils/misc_util.py", line 957, in add_subpackage 
    caller_level = 2) 
File "/usr/lib64/python2.6/site-packages/numpy/distutils/misc_util.py", line 926, in get_subpackage 
    caller_level = caller_level + 1) 
File "/usr/lib64/python2.6/site-packages/numpy/distutils/misc_util.py", line 863, in _get_configuration_from_setup_py 
    config = setup_module.configuration(*args) 
File "scipy/cluster/setup.py", line 24, in configuration 
    extra_info=blas_opt) 
File "/usr/lib64/python2.6/site-packages/numpy/distutils/misc_util.py", line 1419, in add_extension 
    ext = Extension(**ext_args) 
File "/usr/lib64/python2.6/site-packages/numpy/distutils/extension.py", line 45, in __init__ 
    export_symbols) 
TypeError: __init__() takes at most 4 arguments (13 given) 

---------------------------------------- 
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-i0GYOd/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-aq6BzP-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-i0GYOd/scipy 

看來numpy的是出 - 當我嘗試升級numpy時,類似的錯誤信息顯示出來。我應該如何在本地文件夾中安裝numpy和scipy?

+0

首先升級'pip'如日誌中所述。它可以解決你的問題。 –

+0

@jean,我升級了點子,但它仍然使用舊版本 –

+0

要小心:如果你的系統中有多個版本的python,它可能會升級另一個! cd在python目錄然後'scripts/pip install --upgrade pip'最好能確定。 –

回答

0

RedHat 6.7自帶Python 2.6,不再支持最新版本的numpy/scipy。除此之外,在Linux上,您不應該使用pip將安裝在軟件包管理器中的軟件包(使用yum,dnf,apt-get等)與從PyPI安裝的軟件包混合使用。 由於大多數Linux發行版都依賴於爲所有類型的程序安裝可用的Python,安裝pip可能很容易破壞事情,即使如此,如果這是在非全局目錄中完成的。

而是始終使用virtualenv並安裝您需要的軟件包。你可以用你的包管理器安裝virtualenv,如果你願意,你可以爲virtualenv創建的virtualenv和升級pipvirtualenv那裏擺脫點子已經過時,並獲得最新的virtualenv消息。

這看起來可能有些過分,但是值得阻止你的公用事業突破。此外,以這種方式工作使得使用比系統提供的更新的Python更容易。假設您安裝了/opt/python/2.7中2.7系列的最新版本,則在創建初始virtualenv(使用軟件包管理器中的virtualenv)時,請將-p /opt/python/2.7/bin/python提供給系統virtualenv

+1

它的工作原理!也不再支持python2.6.6,所以我使用python2.7創建virtualenv。 numpy和scipy都可以現在安裝。 –

+0

我會在答案中加入。 – Anthon