Issue adding SofaPython3 plugin in runSofa v24.06.00: init_fs_encoding error #5141
Replies: 1 comment 5 replies
-
I'm not using Windows, but in general python problem like the one you are reporting are because there are interference between different python version (the one expected by sofa and the ones installed in your system). From the error message I have the impression that python does not find the default modules ("encodings" is one of the default packages, and thus it seems python is not able to load it). Maybe conda is using PYTHONPATH and you setting it on your side thus lossing where conda installs the defaults modules. I thinks this may be related to that one: One of the answers there is:
|
Beta Was this translation helpful? Give feedback.
-
Hello Sofa community,
I am a new user wishing to try Sofa with python.
I installed Sofa v24.06.00 from binaries, on Windows, and runSofa works fine.
I installed python 3.10.15 (in a CONDA environment)
I have also set the system variables as follows:
SOFA_ROOT C:\Users\FRICKERS\SOFA\v24.06.00
PYTHON_ROOT C:\Users\FRICKERS\AppData\Local\anaconda3\envs\SOFA
PYTHONPATH %SOFA_ROOT%\plugins\SofaPython3\lib\python3\site-packages
PATH ...;%PYTHON_ROOT%;%PYTHON_ROOT%\DLLs;%PYTHON_ROOT%\Lib;%SOFA_ROOT%\bin
When I launch runSofa and try to add the SofaPython3 plugin via the plugin manager, I get the following message in the runSofa console:
[INFO] [SofaPython3] Initializing with python version 3.10.15 | packaged by Anaconda, Inc. | (main, Oct 3 2024, 07:22:19) [MSC v.1929 64 bit (AMD64)]
[INFO] [SofaPython3] Registering a scene loader for [.py, .py3, .pyscn, .py3scn] files.
[INFO] [SofaPython3] Initializing python
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = 'C:\Users\FRICKERS\SOFA\v24.06.00\plugins\SofaPython3\lib\python3\site-packages'
program name = 'python'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'C:\Users\FRICKERS\SOFA\v24.06.00\bin\runSofa.exe'
sys.base_prefix = 'C:\Users\FRICKERS\AppData\Local\anaconda3\envs\SOFA'
sys.base_exec_prefix = 'C:\Users\FRICKERS\AppData\Local\anaconda3\envs\SOFA'
sys.platlibdir = 'lib'
sys.executable = 'C:\Users\FRICKERS\SOFA\v24.06.00\bin\runSofa.exe'
sys.prefix = 'C:\Users\FRICKERS\AppData\Local\anaconda3\envs\SOFA'
sys.exec_prefix = 'C:\Users\FRICKERS\AppData\Local\anaconda3\envs\SOFA'
sys.path = [
'C:\Users\FRICKERS\SOFA\v24.06.00\plugins\SofaPython3\lib\python3\site-packages',
'C:\Users\FRICKERS\AppData\Local\anaconda3\envs\SOFA\python310.zip',
'C:\Users\FRICKERS\SOFA\v24.06.00\bin',
]
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'
Do you have any idea as to what this init_fs_encoding issue could be related ?
Beta Was this translation helpful? Give feedback.
All reactions