gcc_termux
gcc_termux copied to clipboard
Scipy import error
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
/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/signal/init.py in
/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/signal/filter_design.py in
/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/optimize/init.py in
/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/optimize/_shgo.py in
/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/spatial/init.py in
/data/data/com.termux/files/usr/lib/python3.10/site-packages/scipy/spatial/transform/init.py in
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"...
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.
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?
Hey guys,
Below is my approach on setting up a python working environment for data processing. Hope it helps!
- Install Alpine Linux via Linuxdeploy on you android device and login using ssh or shell.
- $ sudo apk update
- 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
- Some modules as well as Jupyter Notebook and Jupyterlab $ pip install mplfinance seaborn nodejs jupyter jupyterlab patsy
- 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)
- 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!