Andereoo / TkinterWeb

Python bindings for Tkhtml.
MIT License
144 stars 15 forks source link

Tkinterweb is not compactible with AARCH64 #74

Open simpleuserdontwatch opened 1 year ago

simpleuserdontwatch commented 1 year ago

Hello, I am trying to make a web browser with Tkinterweb\ But, I got this error:

_tkinter.TclError: couldn't load file "/data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/tkinterweb/tkhtml/Linux/64-bit/Tkhtml30.so": dlopen failed: "/data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/tkinterweb/tkhtml/Linux/64-bit/Tkhtml30.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)

How to fix this?

Andereoo commented 1 year ago

Hi! Thanks for submitting a bug report. I'm away for the summer and don't have access to a computer, but I will defenitely look into this in September when I return. I hope this isn't too much of a nuisance.

Andereoo commented 9 months ago

Hi @simpleuserdontwatch the fixes for #24 may have fixed this. Try upgrading TkinterWeb and let me know if it works.

simpleuserdontwatch commented 9 months ago

still not fixed. There's an another exception, if you need it, then here is it:

Traceback (most recent call last):
  File "/data/user/0/ru.iiec.pydroid3/files/temp_iiec_codefile.py", line 8, in <module>
    frame = HtmlFrame(root) #create HTML browser
            ^^^^^^^^^^^^^^^
  File "/data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/tkinterweb/htmlwidgets.py", line 56, in __init__
    self.html = html = TkinterWeb(self, message_func, HtmlFrame)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/tkinterweb/bindings.py", line 116, in __init__
    load_tkhtml(master, folder, force=True)
  File "/data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/tkinterweb/utilities.py", line 992, in load_tkhtml
    master.tk.eval("package require Tkhtml")
_tkinter.TclError: couldn't load file "/data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/tkinterweb/tkhtml/Linux/64-bit/libTkhtml3.0.so": dlopen failed: "/data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/tkinterweb/tkhtml/Linux/64-bit/libTkhtml3.0.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
Andereoo commented 9 months ago

That's weird... Can you replace the file data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/tkinterweb/tkhtml/Linux/64-bit/libTkhtml3.0.so with the one from /data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/tkinterweb/tkhtml/Linux/arc/libTkhtml3.0.so and let me know what happens?

simpleuserdontwatch commented 9 months ago

That's weird... Can you replace the file data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/tkinterweb/tkhtml/Linux/64-bit/libTkhtml3.0.so with the one from /data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/tkinterweb/tkhtml/Linux/arc/libTkhtml3.0.so and let me know what happens?

cp: can't stat '/data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/tkinterweb/tkhtml/Linux/arc/libTkhtml3.0.so': No such file or directory
Andereoo commented 9 months ago

It looks like you're not using the latest version of TkinterWeb. It should be version 3.23.5. Try upgrading, and let me know what happens.

simpleuserdontwatch commented 9 months ago

It looks like you're not using the latest version of TkinterWeb. It should be version 3.23.5. Try upgrading, and let me know what happens.

Its already at last version..

/storage/emulated/0 $ pip install -U tkinterweb
Requirement already satisfied: tkinterweb in /data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages (3.23.5)
Requirement already satisfied: pillow in /data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages (from tkinterweb) (10.1.0)
Andereoo commented 9 months ago

Oops... my bad. The file to copy is in tkinterweb/tkhtml/Linux/arm/ and not tkinterweb/tkhtml/Linux/arc.

On Tue, Nov 21, 2023, 11:59 p.m. Simpleuser @.***> wrote:

It looks like you're not using the latest version of TkinterWeb. It should be version 3.23.5. Try upgrading, and let me know what happens.

Its already at last version..

/storage/emulated/0 $ pip install -U tkinterweb Requirement already satisfied: tkinterweb in /data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages (3.23.5) Requirement already satisfied: pillow in /data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages (from tkinterweb) (10.1.0)

— Reply to this email directly, view it on GitHub https://github.com/Andereoo/TkinterWeb/issues/74#issuecomment-1822117450, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMA4CXSHVINNLCKD4FWIG4DYFWBE5AVCNFSM6AAAAAAZ65DSNOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRSGEYTONBVGA . You are receiving this because you commented.Message ID: @.***>

simpleuserdontwatch commented 9 months ago

I just did it, but it still errors with a different error:

Traceback (most recent call last):
  File "/data/user/0/ru.iiec.pydroid3/files/temp_iiec_codefile.py", line 8, in <module>
    frame = HtmlFrame(root) #create HTML browser
            ^^^^^^^^^^^^^^^
  File "/data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/tkinterweb/htmlwidgets.py", line 56, in __init__
    self.html = html = TkinterWeb(self, message_func, HtmlFrame)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/tkinterweb/bindings.py", line 116, in __init__
    load_tkhtml(master, folder, force=True)
  File "/data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/tkinterweb/utilities.py", line 992, in load_tkhtml
    master.tk.eval("package require Tkhtml")
_tkinter.TclError: couldn't load file "/data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/tkinterweb/tkhtml/Linux/64-bit/libTkhtml3.0.so": dlopen failed: "/data/data/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.11/site-packages/tkinterweb/tkhtml/Linux/64-bit/libTkhtml3.0.so" is 32-bit instead of 64-bit
Andereoo commented 9 months ago

It looks like I need to compile the underlying HTML engine for arch64 Linux systems. It might be a while before I have the time to work this out. If you would like, you are always welcome to try compiling it yourself from https://github.com/Andereoo/TkinterWeb-Tkhtml/tree/main. The commands should be more or less as follows:

TCL=/usr
export PATH=$TCL/bin:$PATH
cd TkinterWeb-Tkhtml
tclsh src/cssprop.tcl && tclsh src/tokenlist.txt & tclsh src/mkdefaultstyle.tcl > htmldefaultstyle.c
mv *.c src && mv *.h src
mkdir build && cd build
sudo ../configure CC="gcc -static-libgcc" --with-tcl=$TCL/lib/tcl8.6 --with-tk=$TCL/lib/tk8.6 --with-tclinclude=$TCL/include/tcl8.6 --with-tkinclude=$TCL/include/tcl8.6
make
simpleuserdontwatch commented 9 months ago

It looks like I need to compile the underlying HTML engine for arch64 Linux systems. It might be a while before I have the time to work this out. If you would like, you are always welcome to try compiling it yourself from https://github.com/Andereoo/TkinterWeb-Tkhtml/tree/main. The commands should be more or less as follows:

TCL=/usr
export PATH=$TCL/bin:$PATH
cd TkinterWeb-Tkhtml
tclsh src/cssprop.tcl && tclsh src/tokenlist.txt & tclsh src/mkdefaultstyle.tcl > htmldefaultstyle.c
mv *.c src && mv *.h src
mkdir build && cd build
sudo ../configure CC="gcc -static-libgcc" --with-tcl=$TCL/lib/tcl8.6 --with-tk=$TCL/lib/tk8.6 --with-tclinclude=$TCL/include/tcl8.6 --with-tkinclude=$TCL/include/tcl8.6
make

Okay, I will try doing it.

Aareon commented 9 months ago

Perhaps wheels for each arch could be provided in releases