Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set correct Python path and Kratos path in GiD #998

Open
veiguf opened this issue Nov 26, 2024 · 4 comments
Open

How to set correct Python path and Kratos path in GiD #998

veiguf opened this issue Nov 26, 2024 · 4 comments
Assignees

Comments

@veiguf
Copy link

veiguf commented Nov 26, 2024

Hi, I successfully compiled Kratos in Ubuntu 24.04 and from terminal it works fine.
can you please help me to set the correct Python path and Kratos path in GiD?

Here what I tried:
Image

And here the resulting error:

Python path configuration:
  PYTHONHOME = '/usr/bin'
  PYTHONPATH = '/home/veit/opt/Kratos/bin/Release:'
  program name = '/usr/bin/python3.11'
  isolated = 0
  environment = 1
  user site = 1
  safe_path = 0
  import site = 1
  is in build tree = 0
  stdlib dir = '/usr/bin/lib/python3.11'
  sys._base_executable = '/usr/bin/python3.11'
  sys.base_prefix = '/usr/bin'
  sys.base_exec_prefix = '/usr/bin'
  sys.platlibdir = 'lib'
  sys.executable = '/usr/bin/python3.11'
  sys.prefix = '/usr/bin'
  sys.exec_prefix = '/usr/bin'
  sys.path = [
    '/home/veit/opt/Kratos/bin/Release',
    '/tmp/gidNHnM4p/UNNAMED.gid',
    '/usr/bin/lib/python311.zip',
    '/usr/bin/lib/python3.11',
    '/usr/bin/lib/python3.11/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007edbdc378080 (most recent call first):
  <no Python frame>

I appreciate any help!

@jginternational
Copy link
Member

Sorry for the late answer. I don't know why I'm not getting GH notifications in the email and I did not see this one.

In my configuration I have it this way

Image

Make sure that the python you set in the Python path box is the same python that you have used to buid the Kratos binaries

@veiguf @roigcarlo

@roigcarlo
Copy link
Member

@jginternational That errors means that python is unable to find its libs folder where encoding and other libs are located. If Kratos can be launcher correctly from the terminal I suspect this is a problem on how GiD is manipulating the paths. Most likely:

'/usr/bin/lib/python311.zip',
'/usr/bin/lib/python3.11',

Those do not exist or are located in a different place.

@veiguf can you try to post the output of this python script?

import encodings as enc
print(enc.__file__)

@veiguf
Copy link
Author

veiguf commented Feb 6, 2025

Hi @jginternational and @roigcarlo, thanks for your answers.

@jginternational: yes python 3.11 is the version I used to build Kratos. FYI here the line in the config file
export PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE:-"/usr/bin/python3.11"}

@roigcarlo: here the output of the script
/usr/lib/python3.11/encodings/__init__.py

The default for usr/bin/python3 as Python path is python3.12 where Kratos is not installed. Thus I think it is not an option.

@roigcarlo
Copy link
Member

roigcarlo commented Feb 6, 2025

That's the problem then, Gid is looking for the scripts /usr/bin/lib/ but they are located in /usr/lib/. @jginternational How can we tell gid to look into that location?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants