-
Notifications
You must be signed in to change notification settings - Fork 23
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
Python exception: ModuleNotFoundError: No module named 'stlib3' #65
Comments
I had a similar issue, a clear(er) solution may be found in my post to the SOFA discussions here. I assume you did the building step as described in the STLIB documentation? This creates many files in the build folder that you specify in the building process. Make sure you have the full path to the stlib3 site-packages directory (stlib3 because it is Python3!) in your |
But according to the newer SOFA version there shouldn't be a need for building the plugin. Just unzip it in the plugin folder of the SOFA directory and add it through the menu. At least that's what I understood. |
That was my understanding as well, however I believe that is merely what SOFA requires, not Python3. Python still needs the necessary build/files in order to connect to the STLIB files in your SOFA directory. I did the out-of-tree-build for SOFA and STLIB, simply downloading the v21.12 SOFA binary. For STLIB, download the most recent update and unzip that into your plugins directory in SOFA (there was a recent update). Then complete the out-of-tree build steps as described in the STLIB README. The key directory |
I have already set the "site-package" in the Python path, but I still have "from stlib3.scene import MainHeader, ContactHeader |
Hi all, The Sofa v21.12 version is shipped with SofaPython3 by default while the SoftRobots plugins was still based on SofaPython2. We updated everything for the robosoft workshop in april 2022. Our mistake that we didn't made that clear on our website. My recommendations to have a working setup:
|
@damienmarchal Thanks! I am using the version for the SoftRobot22 conference on Windows platform and python3.8. But I still got some import error of Stlib3. May I ask the new version at the end of June will fix this issue and enable to extract the stiffness matrix and cosserat rod modeling? |
About the matrices export I know that @alxbilger made pull request recently, sofa-framework/SofaPython3#262 . About the cosserat rod modelling, the best is to ask @younesssss if the plugin will be ready for that timeline. |
Hey @ozilxu,
What are the new errors? |
@younesssss I am using this version with Windows platform and python3.8: https://github.com/SofaDefrost/RoboSoft2022/releases/tag/release-main). But I still got "ModuleNotFoundError: No module named 'stlib3'" error when using the tutorial of the Softrobots plugin. Even though I have already set the "site-package" in the Python path and in the system configuration. |
@younesssss Thanks again for your help! I have searched the directory of the plugin (The version with Windows platform and python3.8: https://github.com/SofaDefrost/RoboSoft2022/releases/tag/release-main) and I didn't find a cosserat plugin. Should I compile it with this repository (https://github.com/SofaDefrost/plugin.Cosserat) on my own with python3? |
Hello, I also have the
|
On Linux it work as expected and the stlib3 python package is located at #dmarchal@defrost-rtx:~/projects/DEFROST/dev/upstream/builds/release/lib/python3/site-packages$ ls
Sofa SofaRuntime SofaTypes splib splib3 stlib3 EDIT1: With a filemanager can you search where cmake has put the stlib3 files (eg: scene.py, wrapper.py) ? I wonder if the packaging is fogetting the files or if they are located at some weird location. EDIT2: A quick look into CMakeLists.txt show that if(SofaPython3_FOUND)
message("-- Found SofaPython3")
SP3_add_python_package(
SOURCE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/python3/src/splib3
TARGET_DIRECTORY splib3
)
SP3_add_python_package(
SOURCE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/python3/src/stlib3
TARGET_DIRECTORY stlib3
)
set(SofaPythonAny_FOUND TRUE)
endif() My next guess would be to look at the SP3_add_python_package |
In the robosoft2022 binary version the STLIB is there: Which actually makes sense but imply to add to PYTHONPATH every python based package unless loaded with a plugin registering extra path (what loading STLIB.dll was doing in the past). |
When trying to load a scene with stlib3.scene the above error shows up. The SOFA framework version is 21.12.00 and the plugin has been downloaded from GitHub and unzipped in the SOFA plugins directory. Is there something that I am missing?
The text was updated successfully, but these errors were encountered: