Long story short: python "sees" some files but not others.
And this is what I'm trying to do:
I want to use "enchant" spellchecking lib in python. I've written some code that works perfectly in external terminal (= linux terminal = system shell), but fails when I run under pycharm. The error message is "ImportError: The 'enchant' C library was not found and maybe needs to be installed.
"
These are other infos somehow related to the problem:
sudo systemctl stop apparmor
" but it doesn't change anything. When apparmor is active it doesn't show any new entry when the code failsPYENCHANT_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/libenchant-2.so.2
" to runtime configuration, I get "OSError: cannot open shared object file: No such file or directory
", that means, thinks the file doesn't exist, as shown in the screenshots.In short, I don't think it's a problem specific from the pyenchant library. I just find VERY weird that the simplest os.path.exists
fails to detect the presence of some files, but detects others. They all are in the same folder and have similar attributes (readable permissions). I can't understand what is happening.
Thanks to @metatoaster for suggesting the right answer!! Apparently the issue is related to flatpak.
I solved the issue by uninstalling Pycharm from flatpak, then downloading the .tar.gz
from Jetbrains website and "installing" that one (actually just unpacking).