Alexey-T / CudaText

Cross-platform text editor, written in Free Pascal
Mozilla Public License 2.0
2.54k stars 174 forks source link

Python path not selectable (Flatpak) #5738

Closed atarax42 closed 1 month ago

atarax42 commented 1 month ago

CudaText 1.218.0.2 under Linux Mint 22 Cinnamon, Flatpak installation

When selecting the menu option Plugins > Python engine was not found; find it... the preset value is /usr/lib. The Pyton path of at least Debian based distributions is /usr/lib/python3. This path can be selected but that has no visible effect. The plugins management cannot be activated.

Alexey-T commented 1 month ago
  1. show exact "pylib__linux" value which you wrote to user.json
  2. show which variants you have found in the dialog "Python engine was not found; find it", before you chosen any of them
atarax42 commented 1 month ago
  1. I found the user.json file, but without keyboard functionality (Bug #5739) it cannot be edited. :-(
  2. There are no variants displayed, only the preset value /usr/lib. Bildschirmfoto vom 2024-10-20 09-43-23
Alexey-T commented 1 month ago

What if you press ok in the dialog, what will it find (and show in menu-like dlg)?

atarax42 commented 1 month ago

Nothing is found and the menu option still displays Plugins > Python engine was not found; find it.... Seems, Flatpak cannot connect to binaries outside of the runtime environment (just a guess).

Alexey-T commented 1 month ago

Yes, right. Then we need to find the Python .so files in the Flatpak container, can you do it by hands?

atarax42 commented 1 month ago

I found a few:

/var/lib/flatpak/runtime/org.kde.Platform/x86_64/6.6/6e6e01960275a437ff2b25aaa019c6057f17517b5f4d7df954f719a2cffcd94f/files/lib/x86_64-linux-gnu/libpython3.so
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/47/active/files/lib/x86_64-linux-gnu/libpython3.so
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/46/active/files/lib/x86_64-linux-gnu/libpython3.so
/var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/24.08/52eee7d3424a54894fa84c360997e9f00d19dc105fd247ce3931f4da157bdd4d/files/lib/x86_64-linux-gnu/libpython3.so
/var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/23.08/active/files/lib/x86_64-linux-gnu/libpython3.so
Alexey-T commented 1 month ago

Then enter in the dialog: /var/lib/flatpak/runtime and press ok again.

Alexey-T commented 1 month ago

Oh, paths have random-like-numbers eg 52eee7d3424a54894fa84c360997e9f00d19dc105fd247ce3931f4da157bdd4d. it may not work after app restart if number changes each time.

atarax42 commented 1 month ago

I entered the path in the dialog, but without visible effect.

BTW: that 'random' number looks like a hash value to me. 64 hex characters. Might be an indicator that changes are unlikely.

Alexey-T commented 1 month ago

I reported both your issues to Flatpak repo: https://github.com/flathub/io.github.cudatext.CudaText-Qt/issues/

JordanL2 commented 1 month ago

Using path /usr/lib/python3 should work. Have you applied any config changes to the flatpak? Overridden the filesystem access level or something?

atarax42 commented 1 month ago

No. Everything runs with default settings, afaik.

JordanL2 commented 1 month ago

You select /usr/lib and let it search for the python3.so, then select /usr/lib/x86_64-linux-gnu/libpython3.so from the list. Then restart Cudatext.

image

atarax42 commented 1 month ago

That's how it should work, but it doesn't in my case. No alternatives are shown. Probably not even the search itself is working.

atarax42 commented 1 month ago

Okay, I did a shutdown and restart of my computer and now I can select the Python lib. This issue seems solved for me. Before I only sent my computer to hibernation when not using it. Why this helped I don't know. However, the keyboard issue persists.