这是indexloc提供的服务,不要输入任何密码
Skip to content

[Bug]: python-torch installation is broken #24728

@Ammar-Husain

Description

@Ammar-Husain

Problem description

importing torch in python after installing python-torch throw this error:

File "<stdin>", line 1, in <module>
  File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/torch/__init__.py", line 405, in <module>
    from torch._C import *  # noqa: F403
    ^^^^^^^^^^^^^^^^^^^^^^
ImportError: dlopen failed: library "libabsl_log_internal_structured_proto.so" not found

and it looks like libabsl is not available in termux as pkg search absl yield nothing.

Note:
I read in another issue that python-torch has been moved to x-11 repo last year but when I install it now it is from main-repo, has it been returned to main repor or I am installing a wrong version?

What steps will reproduce the bug?

install python-torch:

pkg i python-torch

import it in python file

import torch

run the file and you will get the above error.

What is the expected behavior?

torch imported without errors.

System information

Termux Variables:
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP__APK_FILE=/data/app/com.termux-YFwn8Mxof9PNTxSV6Ga_NA==/base.apk
TERMUX_APP__APK_RELEASE=F_DROID
TERMUX_APP__APP_VERSION_CODE=1020
TERMUX_APP__APP_VERSION_NAME=0.119.0-beta.1
TERMUX_APP__DATA_DIR=/data/user/0/com.termux
TERMUX_APP__IS_DEBUGGABLE_BUILD=false
TERMUX_APP__IS_INSTALLED_ON_EXTERNAL_STORAGE=false
TERMUX_APP__PACKAGE_NAME=com.termux
TERMUX_APP__PID=18016
TERMUX_APP__TARGET_SDK=28
TERMUX_VERSION=0.119.0-beta.1
TERMUX__SE_FILE_CONTEXT=u:object_r:app_data_file:s0:c18,c257,c512,c768
TERMUX__SE_INFO=default:targetSdkVersion=28:complete
TERMUX__SE_PROCESS_CONTEXT=u:r:untrusted_app_27:s0:c18,c257,c512,c768
TERMUX__UID=10274
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirror.quantum5.ca/termux/termux-main stable main
# root-repo (sources.list.d/root.list)
deb https://mirror.quantum5.ca/termux/termux-root root stable
# x11-repo (sources.list.d/x11.list)
deb https://mirror.quantum5.ca/termux/termux-x11 x11 main
Updatable packages:
abseil-cpp/stable 20250127.1 aarch64 [upgradable from: 20240116.2-1]
adwaita-icon-theme/x11 48.0 all [upgradable from: 47.0]
android-tools/stable 35.0.2-2 aarch64 [upgradable from: 35.0.2]
appstream/stable 1.0.5 aarch64 [upgradable from: 1.0.4]
at-spi2-core/stable 2.56.2 aarch64 [upgradable from: 2.54.0]
bash-completion/stable 2.16.0 all [upgradable from: 2.15.0]
bash/stable 5.2.37-2 aarch64 [upgradable from: 5.2.37]
bc/stable 1.08.1 aarch64 [upgradable from: 1.07.1-1]
brotli/stable 1.1.0-1 aarch64 [upgradable from: 1.1.0]
c-ares/stable 1.34.5 aarch64 [upgradable from: 1.34.3]
ca-certificates-java/stable 1:2025.02.25 all [upgradable from: 1:2024.09.24]
ca-certificates/stable 1:2025.02.25 all [upgradable from: 1:2024.09.24]
command-not-found/stable 2.4.0-75 aarch64 [upgradable from: 2.4.0-54]
coreutils/stable 9.6-1 aarch64 [upgradable from: 9.5-3]
curl/stable 8.13.0 aarch64 [upgradable from: 8.12.1]
dbus/stable 1.16.2-1 aarch64 [upgradable from: 1.15.6-3]
dconf/x11 0.40.0-5 aarch64 [upgradable from: 0.40.0-4]
debianutils/stable 5.22 aarch64 [upgradable from: 5.21]
desktop-file-utils/x11 0.28-2 aarch64 [upgradable from: 0.28]
diffutils/stable 3.12 aarch64 [upgradable from: 3.10]
dnsutils/stable 9.20.8 aarch64 [upgradable from: 9.16.41]
double-conversion/stable 3.3.1 aarch64 [upgradable from: 3.3.0]
ed/stable 1.21.1 aarch64 [upgradable from: 1.20.2]
enchant/stable 2.8.4 aarch64 [upgradable from: 2.8.2-1]
exo/x11 4.20.0 aarch64 [upgradable from: 4.18.0]
ffmpeg/stable 7.1.1-3 aarch64 [upgradable from: 6.1.2-2]
file-roller-help/x11 44.5 all [upgradable from: 44.4]
file-roller/x11 44.5 aarch64 [upgradable from: 44.4]
file/stable 5.46-1 aarch64 [upgradable from: 5.45]
firefox/x11 138.0.3 aarch64 [upgradable from: 132.0.2-1]
fish/stable 4.0.2-1 aarch64 [upgradable from: 3.7.1-2]
fluidsynth/stable 2.4.6 aarch64 [upgradable from: 2.4.1]
fmt/stable 1:11.1.4 aarch64 [upgradable from: 1:11.0.2]
fontconfig/stable 2.16.2 aarch64 [upgradable from: 2.15.0]
game-music-emu/stable 0.6.4 aarch64 [upgradable from: 0.6.3-1]
garcon/x11 4.20.0 aarch64 [upgradable from: 4.18.1]
gawk/stable 5.3.1 aarch64 [upgradable from: 5.3.0]
gcr4/x11 4.4.0.1 aarch64 [upgradable from: 4.3.0]
gdbm/stable 1.25 aarch64 [upgradable from: 1.24]
gdk-pixbuf/stable 2.42.12-3 aarch64 [upgradable from: 2.42.12]
gh/stable 2.72.0 aarch64 [upgradable from: 2.63.2]
glib-bin/stable 2.84.1-1 aarch64 [upgradable from: 2.82.2]
glib-networking/stable 2.80.1 aarch64 [upgradable from: 2.80.0]
glib/stable 2.84.1-3 aarch64 [upgradable from: 2.82.2]
gnupg/stable 2.5.5 aarch64 [upgradable from: 2.4.5-3]
gperf/stable 3.3 aarch64 [upgradable from: 3.1-7]
gpgv/stable 2.5.5 aarch64 [upgradable from: 2.4.5-3]
gradle/stable 1:8.14 all [upgradable from: 1:8.11.1]
grep/stable 3.12 aarch64 [upgradable from: 3.11]
gsettings-desktop-schemas/x11 48.0 all [upgradable from: 47.1]
gst-plugins-bad/stable 1.26.1 aarch64 [upgradable from: 1.24.10]
gst-plugins-base/stable 1.26.1 aarch64 [upgradable from: 1.24.10]
gst-plugins-good/stable 1.26.1 aarch64 [upgradable from: 1.24.10]
gstreamer/stable 1.26.1 aarch64 [upgradable from: 1.24.10]
gtk-update-icon-cache/x11 3.24.49-3 aarch64 [upgradable from: 3.24.43]
gtk3/x11 3.24.49-3 aarch64 [upgradable from: 3.24.43]
gtk4/x11 4.18.5 aarch64 [upgradable from: 4.16.7]
gvfs/x11 1.57.2-1 aarch64 [upgradable from: 1.55.1]
gzip/stable 1.14 aarch64 [upgradable from: 1.13]
harfbuzz-icu/stable 11.2.1 aarch64 [upgradable from: 10.1.0-1]
harfbuzz/stable 11.2.1 aarch64 [upgradable from: 10.1.0-1]
helix/stable 25.01.1-1 aarch64 [upgradable from: 24.07-2]
imagemagick/stable 7.1.1.47-1 aarch64 [upgradable from: 7.1.1.43]
imlib2/stable 1.12.5 aarch64 [upgradable from: 1.12.3-1]
inetutils/stable 2.6 aarch64 [upgradable from: 2.5]
iso-codes/x11 4.18.0 all [upgradable from: 4.17.0]
json-glib/stable 1.10.6 aarch64 [upgradable from: 1.10.0]
kotlin/stable 2.1.21 all [upgradable from: 2.1.0]
less/stable 668 aarch64 [upgradable from: 661]
libadwaita/x11 1.7.2 aarch64 [upgradable from: 1.6.2]
libaom/stable 3.12.1 aarch64 [upgradable from: 3.11.0]
libassuan/stable 3.0.2 aarch64 [upgradable from: 3.0.1-2]
libblkid/stable 2.40.2-3 aarch64 [upgradable from: 2.40.2-2]
libbluray/stable 1.3.4-2 aarch64 [upgradable from: 1.3.4-1]
libcaca/stable 0.99.beta20-2 aarch64 [upgradable from: 0.99.beta20-1]
libcairo/stable 1.18.4-1 aarch64 [upgradable from: 1.18.2]
libcompiler-rt/stable 20.1.4 aarch64 [upgradable from: 19.1.5]
libcurl/stable 8.13.0 aarch64 [upgradable from: 8.12.1]
libdav1d/stable 1.5.1 aarch64 [upgradable from: 1.5.0]
libdecor/x11 0.2.3 aarch64 [upgradable from: 0.2.2-1]
libdevmapper/root 2.03.32 aarch64 [upgradable from: 2.03.29]
libdw/stable 0.192 aarch64 [upgradable from: 0.191]
libelf/stable 0.192 aarch64 [upgradable from: 0.191]
libexif/stable 0.6.25 aarch64 [upgradable from: 0.6.24]
libexpat/stable 2.7.1 aarch64 [upgradable from: 2.6.4]
libffi/stable 3.4.7 aarch64 [upgradable from: 3.4.6-1]
libflac/stable 1.5.0 aarch64 [upgradable from: 1.4.3]
libgnutls/stable 3.8.9 aarch64 [upgradable from: 3.8.5]
libgpg-error/stable 1.55 aarch64 [upgradable from: 1.50]
libheif/stable 1.19.8 aarch64 [upgradable from: 1.19.5]
libice/stable 1.1.2 aarch64 [upgradable from: 1.1.1]
libiconv/stable 1.18 aarch64 [upgradable from: 1.17]
libicu/stable 77.1-1 aarch64 [upgradable from: 76.1]
libimagequant/stable 4.3.4 aarch64 [upgradable from: 4.3.3]
libjansi/stable 2.4.2 aarch64 [upgradable from: 2.4.1]
libjasper/stable 4.2.5 aarch64 [upgradable from: 4.2.4]
libjpeg-turbo/stable 3.1.0 aarch64 [upgradable from: 3.0.4]
libltdl/stable 2.5.4-1 aarch64 [upgradable from: 2.5.4]
liblzma/stable 5.8.1 aarch64 [upgradable from: 5.6.3]
libmaxminddb/stable 1.12.2 aarch64 [upgradable from: 1.12.0]
libmount/stable 2.40.2-3 aarch64 [upgradable from: 2.40.2-2]
libmp3lame/stable 3.100-6 aarch64 [upgradable from: 3.100-5]
libnettle/stable 3.10.1 aarch64 [upgradable from: 3.10]
libnghttp2/stable 1.65.0 aarch64 [upgradable from: 1.64.0]
libnghttp3/stable 1.9.0 aarch64 [upgradable from: 1.6.0]
libnotify/x11 0.8.6 aarch64 [upgradable from: 0.8.3-1]
libnss/stable 3.111 aarch64 [upgradable from: 3.107]
libopenblas/stable 0.3.29 aarch64 [upgradable from: 0.3.28]
libopenmpt/stable 0.7.13 aarch64 [upgradable from: 0.7.12]
libpixman/stable 0.46.0 aarch64 [upgradable from: 0.44.2]
libpng/stable 1.6.48 aarch64 [upgradable from: 1.6.44]
librav1e/stable 0.7.1-3 aarch64 [upgradable from: 0.7.1-2]
libraw/stable 0.21.4 aarch64 [upgradable from: 0.21.3]
librsvg/stable 2.60.0-2 aarch64 [upgradable from: 2.59.2]
libsm/stable 1.2.6 aarch64 [upgradable from: 1.2.4-1]
libsmartcols/stable 2.40.2-3 aarch64 [upgradable from: 2.40.2-2]
libsnappy/stable 1.2.2 aarch64 [upgradable from: 1.1.10]
libsndfile/stable 1.2.2-1 aarch64 [upgradable from: 1.2.2]
libsoup3/stable 3.6.5 aarch64 [upgradable from: 3.6.1]
libsqlite/stable 3.49.2 aarch64 [upgradable from: 3.47.2]
libtasn1/stable 4.20.0 aarch64 [upgradable from: 4.19.0-1]
libtool/stable 2.5.4-1 aarch64 [upgradable from: 2.5.4]
libunbound/stable 1.23.0 aarch64 [upgradable from: 1.22.0]
libuuid/stable 2.40.2-3 aarch64 [upgradable from: 2.40.2-2]
libuv/stable 1.51.0 aarch64 [upgradable from: 1.49.2]
libvte/x11 2:0.80.1 aarch64 [upgradable from: 2:0.76.4-1]
libwayland/stable 1.23.1-2 aarch64 [upgradable from: 1.23.1-1]
libwebp/stable 1.5.0 aarch64 [upgradable from: 1.4.0-rc1-0]
libwebrtc-audio-processing/stable 1.3-2 aarch64 [upgradable from: 1.3-1]
libwnck/x11 43.2 aarch64 [upgradable from: 43.1]
libx11/stable 1.8.12 aarch64 [upgradable from: 1.8.10]
libx265/stable 4.1 aarch64 [upgradable from: 3.5-p20230222-0]
libxau/stable 1.0.12 aarch64 [upgradable from: 1.0.11]
libxfce4ui/x11 4.20.1 aarch64 [upgradable from: 4.18.6-2]
libxfce4util/x11 4.20.1 aarch64 [upgradable from: 4.18.2]
libxft/stable 2.3.9 aarch64 [upgradable from: 2.3.8]
libxkbcommon/x11 1.9.2 aarch64 [upgradable from: 1.7.0]
libxklavier/x11 5.4-27 aarch64 [upgradable from: 5.4-26]
libxmlb/stable 0.3.22 aarch64 [upgradable from: 0.3.21]
libxrender/stable 0.9.12 aarch64 [upgradable from: 0.9.11]
libxshmfence/stable 1.3.3 aarch64 [upgradable from: 1.3.2-1]
libxslt/stable 1.1.43-1 aarch64 [upgradable from: 1.1.42-1]
libxv/stable 1.0.13 aarch64 [upgradable from: 1.0.12]
libxxf86vm/stable 1.1.6 aarch64 [upgradable from: 1.1.5-1]
libzip/stable 1.11.3 aarch64 [upgradable from: 1.11.2]
littlecms/stable 2.17 aarch64 [upgradable from: 2.16]
lua-language-server/stable 3.14.0 aarch64 [upgradable from: 3.13.5]
luv/stable 1.51.0-0-0 aarch64 [upgradable from: 1.48.0-2-0]
lxde-icon-theme/x11 0.5.2 all [upgradable from: 0.5.1-22]
lzip/stable 1.25 aarch64 [upgradable from: 1.24.1]
mount-utils/stable 2.40.2-3 aarch64 [upgradable from: 2.40.2-2]
mpg123/stable 1.32.10 aarch64 [upgradable from: 1.32.9]
nano/stable 8.4 aarch64 [upgradable from: 8.2]
neovim/stable 0.11.1-1 aarch64 [upgradable from: 0.10.3]
nginx/stable 1.28.0 aarch64 [upgradable from: 1.27.3]
nodejs/stable 23.11.0 aarch64 [upgradable from: 22.8.0-1]
ocl-icd/stable 2.3.3 aarch64 [upgradable from: 2.3.2]
openal-soft/stable 1.24.3 aarch64 [upgradable from: 1.24.1]
opengl/stable 4.5 all [upgradable from: 0.1]
openh264/stable 2.6.0 aarch64 [upgradable from: 2.5.0]
openjdk-17-x/stable 17.0.15-1 aarch64 [upgradable from: 17.0-37]
openjdk-17/stable 17.0.15-1 aarch64 [upgradable from: 17.0-37]
openjpeg/stable 2.5.3 aarch64 [upgradable from: 2.5.2]
openssh-sftp-server/stable 10.0p2-7 aarch64 [upgradable from: 9.9p1-4]
openssh/stable 10.0p2-7 aarch64 [upgradable from: 9.9p1-4]
openssl-tool/stable 1:3.4.1 aarch64 [upgradable from: 1:3.3.2]
openssl/stable 1:3.4.1 aarch64 [upgradable from: 1:3.3.2]
p7zip/stable 17.06 aarch64 [upgradable from: 17.05-1]
pango/stable 1.56.3-1 aarch64 [upgradable from: 1.54.0]
patch/stable 2.8 aarch64 [upgradable from: 2.7.6-4]
pcre2/stable 10.45 aarch64 [upgradable from: 10.44]
php/stable 8.4.2-2 aarch64 [upgradable from: 8.4.2]
postgresql/stable 17.0-3 aarch64 [upgradable from: 17.0-1]
proot-distro/stable 4.25.0 all [upgradable from: 4.17.3]
python-ensurepip-wheels/stable 3.12.10 all [upgradable from: 3.12.8]
python-numpy/stable 2.2.5 aarch64 [upgradable from: 2.2.0]
python-pillow/stable 11.1.0-1 aarch64 [upgradable from: 11.0.0]
python-scipy/stable 1.15.3 aarch64 [upgradable from: 1.14.1-1]
python-tkinter/stable 3.12.10 aarch64 [upgradable from: 3.12.8]
python/stable 3.12.10 aarch64 [upgradable from: 3.12.8]
qt6-qt5compat/x11 6.9.0 aarch64 [upgradable from: 6.8.1]
qt6-qtbase/x11 6.9.0 aarch64 [upgradable from: 6.8.1]
qt6-qtdeclarative/x11 6.9.0 aarch64 [upgradable from: 6.8.1]
qt6-qtlanguageserver/x11 6.9.0 aarch64 [upgradable from: 6.8.1]
qt6-qtmultimedia/x11 6.9.0 aarch64 [upgradable from: 6.8.1]
qt6-shadertools/x11 6.9.0 aarch64 [upgradable from: 6.8.1]
rhash/stable 1.4.6 aarch64 [upgradable from: 1.4.5]
ruby-ri/stable 3.4.1-1 all [upgradable from: 3.3.6]
ruby/stable 3.4.1-1 aarch64 [upgradable from: 3.3.6]
runc/root 1.3.0 aarch64 [upgradable from: 1.1.15-1]
rust-std-aarch64-linux-android/stable 1.86.0 all [upgradable from: 1.83.0-2]
sdl2/x11 2.32.6 aarch64 [upgradable from: 2.32.2]
sdl/x11 1.2.60-1 aarch64 [upgradable from: 1.2.60]
shared-mime-info/x11 2.4-3 aarch64 [upgradable from: 2.4]
strace/stable 6.14 aarch64 [upgradable from: 6.12]
stylua/stable 2.1.0 aarch64 [upgradable from: 2.0.2]
svt-av1/stable 3.0.2 aarch64 [upgradable from: 2.3.0]
termux-api/stable 0.59.1 aarch64 [upgradable from: 0.58.0-1]
termux-exec/stable 1:2.4.0 aarch64 [upgradable from: 1:1.0]
termux-licenses/stable 2.1 all [upgradable from: 2.0-3]
termux-tools/stable 1.46.0+really1.45.0 aarch64 [upgradable from: 1.44.6]
thunar-archive-plugin/x11 0.5.3 aarch64 [upgradable from: 0.5.2]
thunar/x11 4.20.2 aarch64 [upgradable from: 4.18.11]
tigervnc/x11 1.15.0-1 aarch64 [upgradable from: 1.14.1]
tree-sitter-c/stable 0.23.5-1 aarch64 [upgradable from: 0.23.4]
tree-sitter-lua/stable 0.3.0-1 aarch64 [upgradable from: 0.2.0]
tree-sitter-markdown/stable 0.4.1 aarch64 [upgradable from: 0.3.2]
tree-sitter-parsers/stable 0.0.2 all [upgradable from: 0.0.1]
tree-sitter-query/stable 0.6.0 aarch64 [upgradable from: 0.4.0-1]
tree-sitter-vim/stable 0.6.0 aarch64 [upgradable from: 0.4.0-1]
tree-sitter-vimdoc/stable 3.0.1-1 aarch64 [upgradable from: 3.0.0-2]
tree-sitter/stable 0.25.4 aarch64 [upgradable from: 0.24.5]
tumbler/x11 4.20.0 aarch64 [upgradable from: 4.18.2]
unbound/stable 1.23.0 aarch64 [upgradable from: 1.22.0]
unrar/stable 7.1.6 aarch64 [upgradable from: 7.1.2]
util-linux/stable 2.40.2-3 aarch64 [upgradable from: 2.40.2-2]
vim-gtk/x11 9.1.1350 aarch64 [upgradable from: 9.1.0900]
vulkan-loader-generic/stable 1.4.315 aarch64 [upgradable from: 1.4.303]
webkit2gtk-4.1/x11 2.48.0-1 aarch64 [upgradable from: 2.42.4-3]
webkitgtk-6.0/x11 2.48.0-1 aarch64 [upgradable from: 2.42.4-2]
which/stable 2.23 aarch64 [upgradable from: 2.21]
wireshark-qt/x11 4.4.6 aarch64 [upgradable from: 4.4.2]
xfce4-notifyd/x11 0.9.7 aarch64 [upgradable from: 0.9.6]
xfce4-panel/x11 4.20.4 aarch64 [upgradable from: 4.18.6]
xfce4-session/x11 4.20.2 aarch64 [upgradable from: 4.18.4]
xfce4-settings/x11 4.20.1 aarch64 [upgradable from: 4.18.6]
xfce4-terminal/x11 1.1.5 aarch64 [upgradable from: 1.1.3]
xfconf/x11 4.20.0 aarch64 [upgradable from: 4.18.3]
xfdesktop/x11 4.20.1 aarch64 [upgradable from: 4.18.1]
xfwm4/x11 4.20.0 aarch64 [upgradable from: 4.18.0]
xkeyboard-config/x11 2.44 all [upgradable from: 2.43-1]
xorg-xauth/x11 1.1.4 aarch64 [upgradable from: 1.1.3-1]
xxhash/stable 0.8.3 aarch64 [upgradable from: 0.8.2]
xz-utils/stable 5.8.1 aarch64 [upgradable from: 5.6.3]
zenity/x11 4.0.5 aarch64 [upgradable from: 4.0.3]
zstd/stable 1.5.7 aarch64 [upgradable from: 1.5.6-2]
termux-tools version:
1.44.6
Android version:
10
Kernel build information:
Linux localhost 4.14.116 #1 SMP PREEMPT Thu Nov 16 17:14:17 CST 2023 aarch64 Android
Device manufacturer:
HUAWEI
Device model:
BAH4-L09
LD Variables:
LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib:
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.api versionCode:50

Output of pkg info python-torch:

Package: python-torch
Version: 2.6.0
Maintainer: @termux
Installed-Size: 284 MB
Depends: libc++, libopenblas, libprotobuf, python, python-numpy, python-pip
Homepage: https://pytorch.org/
Download-Size: 39.6 MB
APT-Manual-Installed: yes
APT-Sources: https://mirror.quantum5.ca/termux/termux-main stable/main aarch64 Packages
Description: Tensors and Dynamic neural networks in Python

Metadata

Metadata

Assignees

No one assigned

    Labels

    not-bugIssue is not a bug or has been resolved

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions