无法在suse 11.3中安装python scipy

2024-06-23 19:28:29 发布

您现在位置:Python中文网/ 问答频道 /正文

我无法在suse11.3中安装scipy。在

我跟踪了这个链接中的文档:

scipy installation

我安装了:

lapack
ATLAS

然后我git克隆scipy并运行python设置.py安装,我一直收到这些错误。我错过了什么步骤吗?在

^{pr2}$

从git安装时出错:

/usr/local/lib64/python2.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

 #warning "Using deprecated NumPy API, disable it by " \

  ^

scipy/cluster/_vq.c: In function ‘__pyx_fuse_0__pyx_f_5scipy_7cluster_3_vq_cal_M’:

scipy/cluster/_vq.c:1538:3: warning: implicit declaration of function ‘sgemm_’ [-Wimplicit-function-declaration]

   f_sgemm(__pyx_k_T, __pyx_k_N, (&__pyx_v_ncodes), (&__pyx_v_nobs), (&__pyx_v_nfeat), (&__pyx_v_alpha), __pyx_v_code_book, (&__pyx_v_nfeat), __pyx_v_obs, (&__pyx_v_nfeat), (&__pyx_v_beta), __pyx_v_M, (&__pyx_v_ncodes));

   ^

scipy/cluster/_vq.c: In function ‘__pyx_fuse_1__pyx_f_5scipy_7cluster_3_vq_cal_M’:

scipy/cluster/_vq.c:1575:3: warning: implicit declaration of function ‘dgemm_’ [-Wimplicit-function-declaration]

   f_dgemm(__pyx_k_T, __pyx_k_N, (&__pyx_v_ncodes), (&__pyx_v_nobs), (&__pyx_v_nfeat), (&__pyx_v_alpha), __pyx_v_code_book, (&__pyx_v_nfeat), __pyx_v_obs, (&__pyx_v_nfeat), (&__pyx_v_beta), __pyx_v_M, (&__pyx_v_ncodes));

   ^

In file included from /usr/local/lib64/python2.6/site-packages/numpy/core/include/numpy/ufuncobject.h:317:0,

                 from scipy/cluster/_vq.c:243:

scipy/cluster/_vq.c: At top level:

/usr/local/lib64/python2.6/site-packages/numpy/core/include/numpy/__ufunc_api.h:241:1: warning: ‘_import_umath’ defined but not used [-Wunused-function]

 _import_umath(void)

 ^

gcc -pthread -shared build/temp.linux-x86_64-2.6/scipy/cluster/_vq.o -L/usr/local/lib64 -L/usr/lib64 -Lbuild/temp.linux-x86_64-2.6 -llapack -lptf77blas -lptcblas -latlas -lpython2.6 -o build/lib.linux-x86_64-2.6/scipy/cluster/_vq.so

/usr/bin/ld: /usr/local/lib64/libptf77blas.a(sgemm.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC

/usr/local/lib64/libptf77blas.a: could not read symbols: Bad value

collect2: error: ld returned 1 exit status

/usr/bin/ld: /usr/local/lib64/libptf77blas.a(sgemm.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC

/usr/local/lib64/libptf77blas.a: could not read symbols: Bad value

collect2: error: ld returned 1 exit status

error: Command "gcc -pthread -shared build/temp.linux-x86_64-2.6/scipy/cluster/_vq.o -L/usr/local/lib64 -L/usr/lib64 -Lbuild/temp.linux-x86_64-2.6 -llapack -lptf77blas -lptcblas -latlas -lpython2.6 -o build/lib.linux-x86_64-2.6/scipy/cluster/_vq.so" failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-5ylcSA-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-86Pqof-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-5ylcSA-build
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 8, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "/usr/local/lib64/python2.6/site-packages/pip-1.5.6-py2.6.egg/pip/__init__.py", line 185, in main
    return command.main(cmd_args)
  File "/usr/local/lib64/python2.6/site-packages/pip-1.5.6-py2.6.egg/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 51: ordinal not in range(128)

Tags: pipbuildnumpylinuxusrlocalnotfunction
2条回答

您的问题是blas/ATLAS-您已经安装并试图链接到的版本没有使用-fPIC选项进行编译。这在您看到的错误消息中显示。^问题的{a1}及其解决方案-总之,您的版本具有静态库(.a),而不是共享库(.so)。在

注意scipy install pages(它们的重点):

There is currently no comfortable way to use ATLAS on openSuse.

这取决于你怎么做-你可以找到一个适合安装在你的系统上的版本,你可以用use BLAS + LAPACK代替ATLAS,或者你可以自己编译ATLAS。关于如何编译自己的说明are here。有关添加-fPIC选项are here的详细信息。在

应该注意的是,scipy文档告诉您使用ashigabou存储库,但是链接是断开的。谷歌展示this repository。内容看起来很旧,但我想你可以完全按照你链接的页面上的流程操作。在


我注意到,如果您从3.9.4版的sourceforge页面下载ATLAS,您可以在ChangeLog中看到开发人员:

  • Added BETA support for auto-building shared/dynamic libraries when the user passes shared to configure (no need to explicitly set compiler flags [eg., -fPIC] for any of the known compilers):
    • Not fully tested, but appears to work for Windows, OS X and Linux
    • Now referenced in make install, but present process is crude
    • with nof77, get clapack reather than lapack; eventually probably want a logical link of lapack

也就是说,您应该能够通过 shared来配置您想要的构建。在

pip install git+https://github.com/scipy/scipy.git

如果您还没有pip,请转到此处: link

然后运行pip install命令。在

相关问题 更多 >

    热门问题