Home › Forum › SoftRobots › Getting Started › SOFA v20.12.02 Error : extension (pyscn) not handled
Tagged: SOFA-v20.12
- This topic has 15 replies, 5 voices, and was last updated 3 years, 4 months ago by Eulalie.
-
AuthorPosts
-
13 April 2021 at 14:19 #19153AryaBlocked
Hi, I just shifted from v19.06 binaries to V20.12.02 zip for sofapython3, But now I am getting these errors for .pyscn files. Is there any other way scene files are supposed to be executed in this version?
13 April 2021 at 18:44 #19154HugoKeymasterDear @aryakarani
You need to make sure that the SofaPython plugin is well loaded.
Which version of SofaPython are used in your scene ?
SofaPython(2) or SofaPython3 ?Best,
Hugo
13 April 2021 at 20:05 #19157AryaBlockedDear @hugo none of the .pyscn files in the SoftRobots plugin are working and I am getting the same error of extension (pyscn) not handled. I suppose the pyscn files in SoftRobots/docs/tutorials are SofaPython2, but I noticed that the new binaries version has a SofaPython3 folder in every tutorial for eg. Tripod which has all the step*.pyscn files in SofaPython3 I think, even these are not being recognized by the GUI and runSofa gives the handle error. Is there not a way to make both sofapython2 and sofapython3 files run with runSofa with the same binaries version
13 April 2021 at 20:30 #19158AryaBlocked@hugo According to me the problem is in not having SofaPython3 in my pluginmanager in my GUI, As the Documentation suggested I added SofaPython3 NO_VERSION to my lib/plugin_list.conf, but the SofaPython3 plugin still doesn’t show up in my GUI plugin manager, Can you tell me how can I permenantly add SofaPython3 as a plugin, I think that might solve the problem of handling .pyscn files.
16 April 2021 at 00:11 #19191HugoKeymasterHey @aryakarani
Have you loaded the SofaPython3 plugin through Edit > Plugin Manager > Add ..
Best
Hugo
16 April 2021 at 08:21 #19195AryaBlockedYes, @hugo, I have tried that, I added libSofaPython3.so and it gives me the following error:
Plugin loading failed (/home/administrator/Downloads/SOFA_v20.12.02_Linux/plugins/SofaPython3/lib/libSofaPython3.so): libpython3.7m.so.1.0: cannot open shared object file: No such file or directory16 April 2021 at 08:56 #19198HugoKeymasterHey @aryakarani
You should have python3.7 installed on your machine.
For Ubuntu, could you please run:sudo apt install libpython3.7 python3.7 python3-pip python3.7 -m pip install numpy
Best
Hugo
16 April 2021 at 09:23 #19199AryaBlockedHey, @hugo That helped, now I can atleast open .pyscn files,
They still have error messages and fail to load in the GUI.
The error messages are like:
[ERROR] [SofaPython3::SceneLoader] SyntaxError: positional argument follows keyword argument (step5.pyscn, line 26)At:
<frozen importlib._bootstrap>(219): _call_with_frames_removed
<frozen importlib._bootstrap_external>(791): source_to_code
<frozen importlib._bootstrap_external>(860): get_code
<frozen importlib._bootstrap_external>(724): exec_module
<frozen importlib._bootstrap>(677): _load_unlocked
<frozen importlib._bootstrap>(696): _load
/usr/lib/python3.7/imp.py(171): load_source
/usr/lib/python3.7/imp.py(234): load_module
<string>(3): <module>and
:
[ERROR] [SofaPython3::SceneLoader] ModuleNotFoundError: No module named ‘stlib3’At:
step1.pyscn(7): <module>
<frozen importlib._bootstrap>(219): _call_with_frames_removed
<frozen importlib._bootstrap_external>(728): exec_module
<frozen importlib._bootstrap>(677): _load_unlocked
<frozen importlib._bootstrap>(696): _load
/usr/lib/python3.7/imp.py(171): load_source
/usr/lib/python3.7/imp.py(234): load_module
<string>(3): <module>Is this because I need to add STLIB and SoftRobots in the plugin manager too?
Or is there a problem with Python3.7?16 April 2021 at 09:36 #19200HugoKeymasterHey @aryakarani
Could you try to add the following path in your environment:
export SOFA_ROOT=/path/to/SOFA export PYTHONPATH=$SOFA_ROOT/plugins/SofaPython3/lib/python3/site-packages
Hugo
16 April 2021 at 09:49 #1920128 April 2021 at 12:15 #19334AryaBlockedHey @hugo I tried doing a reinstallation of both SOFA and Python3, I made Python3.7.1 as my python3 default verison. After reinstalling SOFA V_20.12 I added SofaPython3 and STLIB in the plugin manager, I am still getting this error:
ImportError: cannot import name ‘Node’ from ‘stlib3.scene’ (/home/administrator/Downloads/SOFA_v20.12.02_Linux/plugins/STLIB/lib/python3/site-packages/stlib3/scene/__init__.py)
At:
step5.py3scn(2): <module>
<frozen importlib._bootstrap>(219): _call_with_frames_removed
<frozen importlib._bootstrap_external>(728): exec_module
<frozen importlib._bootstrap>(677): _load_unlocked
<frozen importlib._bootstrap>(696): _load
/usr/lib/python3.7/imp.py(171): load_source
/usr/lib/python3.7/imp.py(234): load_module
<string>(3): <module>Can you provide a solution?
28 April 2021 at 23:21 #19344AnthonyBlockedI have the same issue on windows 10. could not load any.pyscn files and have installed both python 3.9.4 and numpy. Is there a way to solve this on windows 10?
30 April 2021 at 16:30 #19351sirasaniBlockedHello @Hugo I also am facing the same errors as @Arya on my computer. I am running Mac OS Big Sur. I have Python@3.7 side-by-side Python@3.9.
When I run
runSofa
with theTripod/details/sofapython3/step1.pyscn
file, theSofaPython3
loader loads allsite-packages
except the one fromSTLIB/lib/python3/site-packages
and I get an error about not finding the modulestlib3
. Please see the logs below.[INFO] [SofaPython3] Initializing with python version 3.7.10 (default, Feb 27 2021, 02:19:57) [Clang 12.0.0 (clang-1200.0.32.29)] [INFO] [SofaPython3] Registering a scene loader for [.py, .py3, .pyscn, .py3scn] files. [INFO] [SofaPython3] Intializing python [INFO] [SofaPython3] Added '/Applications/SOFA_v20.12.00_MacOS/plugins/SofaPython3/lib/python3/site-packages' to sys.path [INFO] [PluginManager] Loaded plugin: /Applications/SOFA_v20.12.00_MacOS/plugins/SofaPython3/lib/libSofaPython3.1.0.dylib [INFO] [PluginManager] Loaded plugin: /Applications/SOFA_v20.12.00_MacOS/plugins/SoftRobots/lib/libSoftRobots.1.0.dylib [INFO] [SofaPython3] Added '/Applications/SOFA_v20.12.00_MacOS/plugins/SoftRobots/lib/python3/site-packages' to sys.path Warning: Setting a new default format with a different version or profile after the global shared context is created may cause issues with context sharing. The constructor with a QGLFormat is deprecated, use the regular contructor instead. [ERROR] [SofaPython3::SceneLoader] ModuleNotFoundError: No module named 'stlib3' At: step1.pyscn(7): <module> <frozen importlib._bootstrap>(219): _call_with_frames_removed <frozen importlib._bootstrap_external>(728): exec_module <frozen importlib._bootstrap>(677): _load_unlocked <frozen importlib._bootstrap>(696): _load /usr/local/opt/python@3.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/imp.py(171): load_source /usr/local/opt/python@3.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/imp.py(234): load_module <string>(3): <module> [INFO] [SceneCheckerVisitor] Validating node "root" with checks: [SceneCheckDuplicatedName, SceneCheckMissingRequiredPlugin, SceneCheckUsingAlias]
On deleting the
STLIB
plugin from the _Plugin Manager_ and then adding theSTLIB/lib/libSTLIB.dylib
again, loads thesite-packages
correctly. At this point, reloading the scene file, does not show the original error.[INFO] [PluginManager] Loaded plugin: /Applications/SOFA_v20.12.00_MacOS/plugins/STLIB/lib/libSTLIB.dylib [INFO] [SofaPython3] Added '/Applications/SOFA_v20.12.00_MacOS/plugins/STLIB/lib/python3/site-packages' to sys.path
But alas, the next run of
runSofa
takes us back to the beginning (missingstlib3
). Is there any way to fix the binaries supplied in the downloads section? I wanted to try out Sofa without having to compile from sources. SOFA v19.06 worked well-ish for me, but I wanted to try the latest and the greatest, especially with Python3 bindings. 😉7 May 2021 at 22:52 #19404HugoKeymasterHi @anthony @sirajissani @aryakarani
This topic is crowded! Sorry to read that you are all three struggling on this topic.
I am unsure about the compatibility of STLIB and SofaPython3.Let me poke the experts: @eulaliecoevoet @damien-marchaluniv-lille1-fr @guillaumeparan
Hugo
13 July 2021 at 18:12 #20023EulalieBlockedHi everyone,
Sorry for the late reply. We are still working on a version of STLIB that is compatible with SofaPython3. It’s not all done yet but you can checkout the WIP branch… It is a work in progress, thus some examples and tutorials of SoftRobots may still not be working. For instance the latest version of SoftRobots/docs/tutorials/Tripod/details/sofapython3/ only works until the step6. We appologize for that, and we are doing our best to improve this as fast as possible.
Otherwise, for those struggling with the set up… here’s what I suggest to do for SofaPython3.
1- The extension “.pyscn” (“.py3scn”, “.py”, and “.py3”) is only recognized by runSofa if the plugin SofaPython3 is added to the runSofa/Edit/Plugin Manager.
2- If you have an error at this stage it’s very likely that python3 and/or numpy is missing. Once installed, on Windows, check that your python path (typically
C:\Python38\
) is added to your SystemProperties/EnvironmentVariable/Path. Don’t forget the\
at the end or it may not browse the repository. You should be able to runpython3
in a terminal, and thenimport numpy
should not return an error.3- Once the above steps work, checkout the WIP branch and verify that STLIB (
.../STLIB/python3/src/stlib3/
and.../STLIB/python3/src/splib3/
) is in your PYTHONPATH: runpython3
in a terminal, thenimport sys
andprint(sys.path)
, you should see the paths to stlib3 and splib3, and the commandimport stlib3
should not return an error. If not, follow these [instructions](https://bic-berkeley.github.io/psych-214-fall-2016/using_pythonpath.html).I hope this helps.
Eulalie -
AuthorPosts
- You must be logged in to reply to this topic.