pythonscipy需要BLAS
我的python程序中有一个依赖项pythonscipy需要BLAS,python,python-2.7,scipy,setup.py,Python,Python 2.7,Scipy,Setup.py,我的python程序中有一个依赖项scipy,我正试图使用setuptools对其进行打包 我在我的setup.py中使用了install\u requires=['scipy','matplotlib'] 运行python setup.py安装时 Processing dependencies for Bland==1.0.a.dev1 Searching for scipy Reading http://pypi.python.org/simple/scipy/ Best match: sc
scipy
,我正试图使用setuptools
对其进行打包
我在我的setup.py中使用了install\u requires=['scipy','matplotlib']
运行python setup.py安装时
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个警告和一个错误,如下所示
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
我找到了,但这是在安装scipy时没有安装setup.py
,它告诉您下载,然后编译fortran文件,最后将它们链接到一个库,安装scipy时,该库必须位于您的搜索路径上。但是我应该如何从setup.py
中执行此操作,或者是否有解决方法
FYI:我正在
virtualenv
中运行此功能,据我所知,您不能使用setup.py
安装系统库。这种机制只适用于Python包及其C扩展(它们可以定义自己对C共享库的依赖关系,但这不是一种解决方案)
您可以尝试多种解决方案,但它们都不在setup.py
文件中:
- 创建一个安装程序(RPM、DEB或Windows软件包),在其中定义对Atlas软件包的依赖关系。然后,系统包管理器(yum、apt-get、hmmm…Windows上无任何内容)负责查找lib并为您的包安装它。
- RPM:直接从
获取setup.py
命令bdist\u RPM
- Windows:您还可以从
setup.py
- DEB:createa
命令bdist\u DEB
- RPM:直接从
- 用作生成机制
- 将Atlas定义为
零件
- 使用
配方下载、配置、制作和“制作安装”Atlas tarballcmmi
- 在定义软件包的
设置之前,请将
ATLAS变量设置为os.environ
setup.py中构建的
目录parts
- 将Atlas定义为
- 只需将Atlas列为软件包的依赖项,并让用户安装即可。将
依赖项保留在scipy
中;这是正确的位置,因为它是一个Python包setup.py