Closed marbetschar closed 1 week ago
Did you update all the packages? Could you provide the version numbers of python-torch and abseil-cpp packages using apt info
command?
I ran pkg upgrade
, yes.
~ pkg info python-torch
Package: python-torch
Version: 2.1.2-1
Maintainer: @termux
Installed-Size: 254 MB
Depends: ffmpeg, libc++, libopenblas, libprotobuf, libzmq, opencv, python, python-numy, python-pip, fmt
...
~ pkg info abseil-cpp
Package: abseil-cpp
Version: 20240116.2
Maintainer: @termux
Installed-Size: 8663 kB
Depends: libc++
Conflicts: libgrpc (<< 1.52.0-1)
...
Latest python-torch version is 2.1.2-4 as of writing this comment. Please try to change the package download mirror using termux-change-repo
command. The mirror that you are using may not have latest packages.
I just gave it a test run and tried multiple mirror groups w/o any success. Switched then to Single mirror
and chose packages.termux.dev
- which does not provide a newer python-torch
version either. It shows python-torch/stable,now 2.1.2-1 aarch64
only.
Seems like there is no newer version available of python-torch
for aarch64
.
python-torch was moved to x11 repository. You have to install x11-repo package to get latest python-torch version.
Though I am not sure why the main repo still has the older python-torch version. It should be removed after that x11 repo migration.
Installed x11-rep
and I'm now able to see python/torch 2.1.2-4
. However, it still doesn't want to work:
pkg uninstall python-torch
apt autoremove
pkg update
pkg install python-torch
Then tried to run the following python file:
# test.py
import torch
print("Hello Torch!")
By running: python test.py
- and I get the following output:
~ python test.py
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
F0000 00:00:1724076654.159573 28995 common.cc:63] This program was compiled against version 3.0.0 of
Protocol Buffer runtime library, which is not compatible with the installed version (4.25.1). Contact the program
author for an update. If you compiled the program yourself, make sure that your headers are from the same
version of Protocol Buffers as your link-time library. (Version verification failed in "out/soong/.intermediates/
frameworks/base/libs/hwui/libhwui/android_arm64_armv8-a_core_static/gen/proto/frameworks/base/libs/hwui/
protos/graphicsstats.pb.cc".)
*** Check failure stack trace: **
Aborted
Probably we should rebuild the python-torch package.
It seems that python-torch
hasn't been deleted from main-repo.
Ping: @Grimler91
It has been removed from main repo some hours ago.
Probably we should rebuild the python-torch package.
Anything I can help with to get the rebuild done? And/or can I provide additional information to find the root cause of the issue?
I just noticed there is a new python-torch version 2.1.2-5
available - and after updating to this, the above mentioned issue is gone. Seems pytorch works now. Thank you very much!
Problem description
When I execute
pkg install python-torch
and then in my python file try toimport torch
, I get the following error message:Steps to reproduce the behavior.
On a freshly installed Termux, run
pkg install python-torch
. Then try to import torch from a python file and execute this python file.What is the expected behavior?
PyTorch should simply work when installed using Termux packages - in fact, I would expect each
python-*
package to work out of the box when installed from official Termux repository.I got similar issues after installing jupyter-lab and trying to start it. The
pyzmq
dependency throws a very similar exception:The solution there was to build pyzmq with the
-lpython3.11
flag:And I've also noticed quite a few other packages seem to have the very same issue - for example numpy and pandas: https://github.com/termux/termux-app/issues/3814
I understand that maybe not every package installed via
pip
works out of the box on Termux. However, If I install packages from Termux repository I would expect them to work. As of today, the usage of python3.11 in Termux seems to be broken.System information
0.118.1
12
Boox Note Air