its-pointless / gcc_termux

Gcc for termux with fortran scipy etc... Use apt for newest updates instructions in README.txt
463 stars 74 forks source link

Scipy import error #136

Open nzx7jv opened 2 years ago

nzx7jv commented 2 years ago

Hi, I'm getting import error on python3.10 when importing scipy. How to fix this? Thanks

ImportError Traceback (most recent call last) /data/data/com.termux/files/usr/tmp/ipykernel_13127/302916529.py in ----> 1 from scipy.signal import find_peaks

/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/signal/init.py in 300 301 from .bsplines import --> 302 from .filter_design import 303 from .fir_filter_design import 304 from .ltisys import

/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/signal/filter_design.py in 14 from numpy.polynomial.polynomial import polyvalfromroots 15 ---> 16 from scipy import special, optimize, fft as sp_fft 17 from scipy.special import comb 18 from scipy._lib._util import float_factorial

/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/optimize/init.py in 419 Bounds) 420 from ._hessian_update_strategy import HessianUpdateStrategy, BFGS, SR1 --> 421 from ._shgo import shgo 422 from ._dual_annealing import dual_annealing 423 from ._qap import quadratic_assignment

/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/optimize/_shgo.py in 7 import logging 8 import warnings ----> 9 from scipy import spatial 10 from scipy.optimize import OptimizeResult, minimize 11 from scipy.optimize._shgo_lib import sobol_seq

/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/spatial/init.py in 105 all += ['distance', 'transform'] 106 --> 107 from . import distance, transform 108 109 from scipy._lib._testutils import PytestTester

/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/spatial/transform/init.py in 17 RotationSpline 18 """ ---> 19 from .rotation import Rotation, Slerp 20 from ._rotation_spline import RotationSpline 21

ImportError: dlopen failed: cannot locate symbol "_PyGen_Send" referenced by "/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/spatial/transform/rotation.cpython-310.so"...

nzx7jv commented 2 years ago

Hey guys, I didn't solve this but instead I found alpine linux on linuxdeploy is much easier on setting up the python environment, as lots of libs can be installed using apk add instead of pip install. Maybe you should try it.

Cheers.

Snow18-2019 commented 2 years ago

Hey guys, I didn't solve this but instead I found alpine linux on linuxdeploy is much easier on setting up the python environment, as lots of libs can be installed using apk add instead of pip install. Maybe you should try it.

Cheers.

Can you elaborate on it?

nzx7jv commented 2 years ago

Hey guys,

Below is my approach on setting up a python working environment for data processing. Hope it helps!

  1. Install Alpine Linux via Linuxdeploy on you android device and login using ssh or shell.
  2. $ sudo apk update
  3. Basic Environment Setup: $ sudo apk add vim wget curl bash git python3 py3-numpy py3-numpy-dev py3-pandas py3-scipy py3-matplotlib py3-scikit-learn gcc g++ make libffi-dev openssl-dev libtool libxml2 libxslt py3-lxml libgcc python3-dev musl-dev libffi-dev openssh cython py3-pip py3-beautifulsoup4
  4. Some modules as well as Jupyter Notebook and Jupyterlab $ pip install mplfinance seaborn nodejs jupyter jupyterlab patsy
  5. Compile install statsmodels:(version 0.12.2) $ git clone https://github.com/statsmodels/statsmodels $ python3 setup.py install --user (use --user if not in root)
  6. Compile install Ta-lib $ wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz $ tar xvf ta-lib-0.4.0-src.tar.gz $ cd ta-lib $ ./configure --prefix=/usr $ Update config.guess and config.sub(for aarch64 only) $ sudo make && sudo make install $ pip install TA-Lib

Before installing any pip modules, look them up first in apk repositories via " apk search XXX".

Cheers!