尝试在Android Termux Python上编译Scipy 3.10
我对 termux 的滚动释放感到非常沮丧,而现在我不考虑以前的python版本和模块
,现在我正在编译最新版本的 scipy ,但在此之前,我正在运行
export BLAS=/data/data/com.termux/files/usr/lib/libblas.so
export LAPACK=/data/data/com.termux/files/usr/lib/liblapack.so
export CC=clang
export CPP=clang++
python runtests.py -v
我通过 pip 安装了一些丢失的软件包 以下是输出&我在这里需要帮助
Building, see build.log...
... build in progress (0:01:00.279236 elapsed)
Running from SciPy source directory.
scipy/linalg/_generate_pyx.py: all files up-to-date
scipy/special/_generate_pyx.py: all files up-to-date
Running scipy/linalg/_generate_pyx.py
Running scipy/special/_generate_pyx.py
Running scipy/stats/_generate_pyx.py
scipy/_lib/_ccallback_c.pyx has not changed
scipy/_lib/_test_deprecation_call.pyx has not changed
scipy/_lib/messagestream.pyx has not changed
scipy/cluster/_hierarchy.pyx has not changed
scipy/_lib/_test_deprecation_def.pyx has not changed
scipy/cluster/_vq.pyx has not changed
scipy/fftpack/convolve.pyx has not changed
scipy/interpolate/_bspl.pyx has not changed
scipy/cluster/_optimal_leaf_ordering.pyx has not changed
scipy/interpolate/_ppoly.pyx has not changed
scipy/interpolate/interpnd.pyx has not changed
scipy/io/matlab/_mio5_utils.pyx has not changed
scipy/io/matlab/_mio_utils.pyx has not changed
scipy/io/matlab/_streams.pyx has not changed
scipy/linalg/_cythonized_array_utils.pyx has not changed
scipy/linalg/_decomp_update.pyx.in has not changed
scipy/linalg/_matfuncs_expm.pyx.in has not changed
scipy/linalg/_matfuncs_sqrtm_triu.pyx has not changed
scipy/linalg/cython_blas.pyx has not changed
scipy/linalg/_solve_toeplitz.pyx has not changed
scipy/linalg/cython_lapack.pyx has not changed
scipy/ndimage/src/_cytest.pyx has not changed
scipy/ndimage/src/_ni_label.pyx has not changed
scipy/optimize/_bglu_dense.pyx has not changed
scipy/optimize/_group_columns.pyx has not changed
scipy/optimize/_highs/cython/src/_highs_constants.pyx has not changed
scipy/optimize/_highs/cython/src/_highs_wrapper.pyx has not changed
scipy/optimize/_lsq/givens_elimination.pyx has not changed
scipy/optimize/_trlib/_trlib.pyx has not changed
scipy/optimize/cython_optimize/_zeros.pyx.in has not changed
scipy/optimize/tnc/_moduleTNC.pyx has not changed
scipy/signal/_max_len_seq_inner.pyx has not changed
scipy/signal/_peak_finding_utils.pyx has not changed
scipy/signal/_sosfilt.pyx has not changed
scipy/signal/_spectral.pyx has not changed
scipy/signal/_upfirdn_apply.pyx has not changed
scipy/sparse/_csparsetools.pyx.in has not changed
scipy/sparse/csgraph/_flow.pyx has not changed
scipy/sparse/csgraph/_matching.pyx has not changed
scipy/sparse/csgraph/_min_spanning_tree.pyx has not changed
scipy/sparse/csgraph/_reordering.pyx has not changed
scipy/sparse/csgraph/_shortest_path.pyx has not changed
scipy/sparse/csgraph/_tools.pyx has not changed
scipy/sparse/csgraph/_traversal.pyx has not changed
scipy/spatial/_ckdtree.pyx has not changed
scipy/spatial/_hausdorff.pyx has not changed
scipy/spatial/_qhull.pyx has not changed
scipy/spatial/_voronoi.pyx has not changed
scipy/spatial/transform/_rotation.pyx has not changed
scipy/special/_comb.pyx has not changed
scipy/special/_ellip_harm_2.pyx has not changed
scipy/special/_test_round.pyx has not changed
scipy/special/_ufuncs.pyx has not changed
scipy/special/_ufuncs_cxx.pyx has not changed
scipy/special/cython_special.pyx has not changed
scipy/stats/_qmc_cy.pyx has not changed
scipy/stats/_sobol.pyx has not changed
scipy/stats/_biasedurn.pyx has not changed
scipy/stats/_stats.pyx has not changed
scipy/stats/_boost/src/beta_ufunc.pyx has not changed
scipy/stats/_boost/src/nbinom_ufunc.pyx has not changed
scipy/stats/_boost/src/binom_ufunc.pyx has not changed
scipy/stats/_boost/src/hypergeom_ufunc.pyx has not changed
scipy/stats/_boost/src/ncf_ufunc.pyx has not changed
scipy/stats/_levy_stable/levyst.pyx has not changed
scipy/stats/_unuran/unuran_wrapper.pyx has not changed
/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/config/pyprojecttoml.py:102: _ExperimentalProjectMetadata: Support for project metadata in `pyproject.toml` is still experimental and may be removed (or change) in future releases.
warnings.warn(msg, _ExperimentalProjectMetadata)
Cythonizing sources
INFO: lapack_opt_info:
INFO: lapack_armpl_info:
INFO: customize UnixCCompiler
INFO: libraries armpl_lp64_mp not found in ['/data/data/com.termux/files/usr/lib']
INFO: NOT AVAILABLE
INFO:
INFO: lapack_mkl_info:
INFO: libraries mkl_rt not found in ['/data/data/com.termux/files/usr/lib']
INFO: NOT AVAILABLE
INFO:
INFO: openblas_lapack_info:
INFO: C compiler: clang -mfloat-abi=softfp -mfpu=vfpv3-d16 -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb -fstack-protector-strong -O3 -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb -fstack-protector-strong -O3 -fPIC
creating /data/data/com.termux/files/usr/tmp/tmpw9i7rrqz/data
creating /data/data/com.termux/files/usr/tmp/tmpw9i7rrqz/data/data
creating /data/data/com.termux/files/usr/tmp/tmpw9i7rrqz/data/data/com.termux
creating /data/data/com.termux/files/usr/tmp/tmpw9i7rrqz/data/data/com.termux/files
creating /data/data/com.termux/files/usr/tmp/tmpw9i7rrqz/data/data/com.termux/files/usr
creating /data/data/com.termux/files/usr/tmp/tmpw9i7rrqz/data/data/com.termux/files/usr/tmp
creating /data/data/com.termux/files/usr/tmp/tmpw9i7rrqz/data/data/com.termux/files/usr/tmp/tmpw9i7rrqz
INFO: compile options: '-c'
INFO: clang: /data/data/com.termux/files/usr/tmp/tmpw9i7rrqz/source.c
INFO: clang /data/data/com.termux/files/usr/tmp/tmpw9i7rrqz/data/data/com.termux/files/usr/tmp/tmpw9i7rrqz/source.o -L/data/data/com.termux/files/usr/lib -lopenblas -o /data/data/com.termux/files/usr/tmp/tmpw9i7rrqz/a.out
INFO: FOUND:
INFO: libraries = ['openblas', 'openblas']
INFO: library_dirs = ['/data/data/com.termux/files/usr/lib']
INFO: language = c
INFO: define_macros = [('HAVE_CBLAS', None)]
INFO:
INFO: FOUND:
INFO: libraries = ['openblas', 'openblas']
INFO: library_dirs = ['/data/data/com.termux/files/usr/lib']
INFO: language = c
INFO: define_macros = [('HAVE_CBLAS', None)]
INFO:
non-existing path in 'scipy/linalg': 'src/lapack_deprecations/LICENSE'
INFO: blas_opt_info:
INFO: blas_armpl_info:
INFO: libraries armpl_lp64_mp not found in ['/data/data/com.termux/files/usr/lib']
INFO: NOT AVAILABLE
INFO:
INFO: blas_mkl_info:
INFO: libraries mkl_rt not found in ['/data/data/com.termux/files/usr/lib']
INFO: NOT AVAILABLE
INFO:
INFO: blis_info:
INFO: libraries blis not found in ['/data/data/com.termux/files/usr/lib']
INFO: NOT AVAILABLE
INFO:
INFO: openblas_info:
INFO: C compiler: clang -mfloat-abi=softfp -mfpu=vfpv3-d16 -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb -fstack-protector-strong -O3 -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb -fstack-protector-strong -O3 -fPIC
creating /data/data/com.termux/files/usr/tmp/tmp0139l74e/data
creating /data/data/com.termux/files/usr/tmp/tmp0139l74e/data/data
creating /data/data/com.termux/files/usr/tmp/tmp0139l74e/data/data/com.termux
creating /data/data/com.termux/files/usr/tmp/tmp0139l74e/data/data/com.termux/files
creating /data/data/com.termux/files/usr/tmp/tmp0139l74e/data/data/com.termux/files/usr
creating /data/data/com.termux/files/usr/tmp/tmp0139l74e/data/data/com.termux/files/usr/tmp
creating /data/data/com.termux/files/usr/tmp/tmp0139l74e/data/data/com.termux/files/usr/tmp/tmp0139l74e
INFO: compile options: '-c'
INFO: clang: /data/data/com.termux/files/usr/tmp/tmp0139l74e/source.c
INFO: clang /data/data/com.termux/files/usr/tmp/tmp0139l74e/data/data/com.termux/files/usr/tmp/tmp0139l74e/source.o -L/data/data/com.termux/files/usr/lib -lopenblas -o /data/data/com.termux/files/usr/tmp/tmp0139l74e/a.out
INFO: FOUND:
INFO: libraries = ['openblas', 'openblas']
INFO: library_dirs = ['/data/data/com.termux/files/usr/lib']
INFO: language = c
INFO: define_macros = [('HAVE_CBLAS', None)]
INFO:
INFO: FOUND:
INFO: libraries = ['openblas', 'openblas']
INFO: library_dirs = ['/data/data/com.termux/files/usr/lib']
INFO: language = c
INFO: define_macros = [('HAVE_CBLAS', None)]
INFO:
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/setup.py", line 532, in <module>
setup_package()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/setup.py", line 528, in setup_package
setup(**metadata)
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/numpy/distutils/core.py", line 135, in setup
config = configuration()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/setup.py", line 438, in configuration
config.add_subpackage('scipy')
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/numpy/distutils/misc_util.py", line 1054, in add_subpackage
config_list = self.get_subpackage(subpackage_name, subpackage_path,
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/numpy/distutils/misc_util.py", line 1020, in get_subpackage
config = self._get_configuration_from_setup_py(
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/numpy/distutils/misc_util.py", line 962, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/scipy/setup.py", line 18, in configuration
config.add_subpackage('optimize')
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/numpy/distutils/misc_util.py", line 1054, in add_subpackage
config_list = self.get_subpackage(subpackage_name, subpackage_path,
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/numpy/distutils/misc_util.py", line 1020, in get_subpackage
config = self._get_configuration_from_setup_py(
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/numpy/distutils/misc_util.py", line 962, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/scipy/optimize/setup.py", line 130, in configuration
config.add_subpackage('_highs')
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/numpy/distutils/misc_util.py", line 1054, in add_subpackage
config_list = self.get_subpackage(subpackage_name, subpackage_path,
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/numpy/distutils/misc_util.py", line 1020, in get_subpackage
config = self._get_configuration_from_setup_py(
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/numpy/distutils/misc_util.py", line 962, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/scipy/optimize/_highs/setup.py", line 63, in configuration
_major_dot_minor = _get_version(
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/scipy/optimize/_highs/setup.py", line 50, in _get_version
with open(CMakeLists, 'r', encoding='utf-8') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/scipy/_lib/highs/CMakeLists.txt'
Build failed! (0:01:17.306152 elapsed)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
在三星Z Flip 4上清洁安装Termux 4
更新
升级
apt apt install python(安装了3.11.1)
以在Termux中管理和访问文件,然后您必须键入以下命令
termux-sterux-sterux-sterap-storage
pkg安装tur-repo
pkg pkg安装python-scipy connection python-scipy
connected usb到计算机和计算机和将我的python脚本复制到电话下载文件夹
cp〜/storage/downloads/file.py〜/从Termux Home运行程序。
您会收到Interp2D的贬值警告,该警告将在Scipy中替换
因此,添加以阻止它们在顶部。
导入警告警告
。FilterWarnings(“忽略”,类别=弃用战争)
结束。 PS
所有锅都很好,并在2D插值阵列上进行了测试。
Clean Install Termux on Samsung Z Flip 4
https://www.youtube.com/watch?v=yDwxmF0Kn-Q
update
upgrade
apt install python (3.11.1 was installed)
To manage and access files in termux then you must type the below command
termux-setup-storage
pkg install tur-repo
pkg install python-scipy
connected phone via usb to a computer and copied my python scripts to phone downloads folder
cp ~/storage/downloads/file.py ~/ to run programs from termux home.
You get Deprecation Warnings for interp2d which will be replaced in scipy
so add to stop them at the top.
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
The end. ps
All woks fine and tested on 2d interpolation arrays.
我认为您想要的是Scipy在Termux中的最新版本。
我认为您使自己很难。
我设法使用termux正确地编译并安装了Python 3.10.4的Scipy 1.8.1。
首先,在安装之前删除所有出口。作为旁注,如果没有
cc
env。设置变量,PIP将使用aarch64-linux-android-clang
默认情况下。您不需要
libblas.so
和liblapack.so
。确实有必要在编译Scipy时拥有Blas/Lapack库,但是您只需在OpenBlas 中通过
pkg获取它们。
完成后,一个简单的
pip安装scipy
对我来说就像是一种魅力(我花了15分钟以上的时间来构建它,所以请耐心等待)。希望它能帮助您^^
I assume that what you want is the latest version of Scipy working in Termux.
I think you are making it difficult for yourself.
I managed to compile and install scipy 1.8.1 correctly for python 3.10.4 using only Termux.
First, get rid of all exports before installation. As a side note, if no
CC
env. variable is set, pip will useaarch64-linux-android-clang
by default.You don't need
libblas.so
andliblapack.so
either.It is indeed necessary to have the BLAS/LAPACK libraries when compiling Scipy, but you can simply get them by
pkg in openblas
.Once done, a simple
pip install scipy
worked like a charm for me (it took me more than 15 minutes to build it, so be patient).Hope it helps you ^^
尽管我无法通过PIP安装Scipy,以for Python 3.11(截至今天,这是Termux中使用的当前版本),但我设法构建了Scipy 1.9.0并手动安装它。
除了我通过pkg安装的一些依赖关系,这些依赖项是由构建系统要求的,例如pytest,我不得不尝试使用不同版本的PIP安装库。工作的所需库和版本是:
我不确定是否需要所有库。安装了它们后,我获得了Scipy-1.9.0的Tarball,未压缩,并执行了Runtests.py(在未压缩树的根部找到)。
之后,在“ build/lib.linux-aarch64-cpython-311/scipy”中创建了Scipy的工作构建,我将其复制到System Package Directory:“ /data/data/com.termux/files/files/home/ ../usr/lib/python3.11/site-packages/“,现在我可以再次使用Scipy。
Although I was unable to install Scipy via pip for Python 3.11, which is the current version used in Termux as of today, I managed to build Scipy 1.9.0 and install it manually.
Apart from some dependencies I installed via pkg, which were requested by the build system, such as pytest, I had to try with different versions of pip-installed libraries. The required libraries and versions that worked were:
I'm not sure if all of them are required. With them installed, I obtained the sources tarball for scipy-1.9.0, uncompressed it, and executed runtests.py (found in the root of the uncompressed tree).
After this, a working build of scipy was created in "build/lib.linux-aarch64-cpython-311/scipy", I copied it to the system package directory: "/data/data/com.termux/files/home/../usr/lib/python3.11/site-packages/", and now I can use scipy again.
您是否按照
另请参见相关的问题和答案无法从源安装Scipy。
Did you initialize the submodules as described in Building Scipy from source
See also the related question and answer Can't install Scipy from source.
运行以下命令和IT工作
Python -M Pip install scipy-only-binary =:all:-extra-index-url https://termux-user-repository.github.io/pypipie/code/code >
Run the following command and it work
python -m pip install scipy --only-binary=:all: --extra-index-url https://termux-user-repository.github.io/pypi
我无法谈论为什么事情倒退了,但是目前(2024)Scipy的默认术语
pkg
软件包产生了python 3.7,Scipy 1.3安装,该安装与系统默认python 3.11无法很好地播放。 .9。我将尝试使用源粉末丸方法,看看我是否可以到达任何地方。会报告。
nb,
pip3
试图安装崩溃的轮子,因为梅森需要特定的fortran编译器的风味,我无法固定...这就是为什么我不简单地走pip3
路由。I can't speak to why things have gone backwards, but currently (2024) the default termux
pkg
package for scipy yields a Python 3.7, Scipy 1.3 installation which does not play nicely with the system default Python 3.11.9.I'm about to try the source tarball approach and see if I get anywhere. Will report back.
NB,
pip3
tries to install a wheel which crashes because Meson requires a particular flavor of Fortran compiler I've not been able to pin down... This is why I'm not simply going thepip3
route.