首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >蟒蛇需要BLAS

蟒蛇需要BLAS
EN

Stack Overflow用户
提问于 2014-03-18 15:20:52
回答 1查看 608关注 0票数 2

在我的python程序中,scipy是一个依赖项,我正在尝试使用setuptools进行打包。

我在我的setup.py中使用了setup.py。

浅谈python setup.py install的运行

代码语言:javascript
复制
Processing dependencies for Bland==1.0.a.dev1
Searching for scipy
Reading http://pypi.python.org/simple/scipy/
Best match: scipy 0.13.3
Downloading https://pypi.python.org/packages/source/s/scipy/scipy-0.13.3.zip#md5=20ff3a867cc5925ef1d654aed2ff7e88
Processing scipy-0.13.3.zip

它一直持续到显示3至4个警告和错误,如下所示

代码语言:javascript
复制
ages/numpy/distutils/system_info.py:1522: 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__)
/home/storm/Documents/bland/local/lib/python2.7/site-packages/numpy/distutils/system_info.py:1531: 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__)
/home/storm/Documents/bland/local/lib/python2.7/site-packages/numpy/distutils/system_info.py:1534: 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__)
error: 
    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

我找到了这个问题,但这是安装没有setup.pysetup.py,它告诉我们下载,然后编译fortran文件,最后将它们链接到一个库,在安装lib时必须在搜索路径上。但是,我应该如何从setup.py来做这件事,或者说有什么工作要做。

FYI:我在virtualenv中运行这个

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-03-18 15:51:47

据我所知,您不能使用setup.py安装系统库。这种机制只适用于Python包及其C扩展(它们可以定义自己对C共享库的依赖关系,但这里并不是这样的解决方案)。

您可以尝试一些解决方案,但它们都在setup.py文件之外:

  • 创建一个安装程序(RPM、DEB或Windows包),在其中定义对Atlas包的依赖。系统包装经理(嗯,嗯,嗯.然后,Windows上没有任何内容负责查找库并为您的包安装库。
    • RPM:记住 --直接从setup.py获得一个bdist_rpm命令
    • Windows:记住 --您还可以从setup.py获得一个bdist_msi命令
    • DEB:stdeb包创建一个bdist_deb命令

  • 使用积木作为构建机制
    • 将阿特拉斯定义为part
    • 使用cmmi配方,以便下载、配置、制作和“使安装”Atlas tarball
    • 在定义包的os.environ之前,将parts变量设置为setup.py内部构建的setup目录。

  • 只需将Atlas作为包的依赖项列出,并让用户安装它。将scipy依赖关系保留在setup.py中;这是正确的位置,因为它是一个setup.py包。
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22483653

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档