12 September 2020 at 5 h 00 min #17128CaiParticipant
Hi, SOFA Forum,
Recently, I have seen many people have some doubts about SofaPython and SofaPython3 because they depend on different python environment, so I hope the Forum can give more details about Sofapython, Sofapython3, and Softrobot Plugin.
As we all know, for SoftRobot plugin, It needs the STLIB plugin to compile. Meanwhile, the STLIB plugin requires the SofaPython plugin as dependencies. So, we need a python2 environment in our Ubuntu.
However, for the command “import Sofa” in the Softrobot plugin, when we use it in .py file to create soft robot scenes. The forum said, “import Sofa” is only compatible with SofaPython3, So,
many people start to install the Sofapython3 in order to use SoftRobots. However, Sofapython3 requires a python3 environment, and we need to install python3. That is to say, we have 2 python environments. How to and when to switch python environments??
Can we only use Sofa, Sofapython3 and SoftRobot to work together?
If we have complied Sofa, Sofapython, STLIB, SoftRobot successfully, next, to add Sofapython3 using out-of-tree build(at this time, we need to change python2 to python3), the compilation
process occur some error, I guess the python2 and python3 confliction.
So please give us more details about how to use the SoftRobot and SofaPython3. Thanks.16 September 2020 at 18 h 35 min #17163HugoKeymaster
- SOFA Consortium
Something is actually incorrect in your statement:
The forum said, “import Sofa” is only compatible with SofaPython3. We might have been unclear about this.
SofaPython(2.7) only allows to run Python script (containing the command “import Sofa”) from the runSofa GUI. If you want to use SOFA from a Python environment (and not using runSofa), there, you have to use SofaPython3.
I hope this makes things more clear.
Currenlty, using one or the other depends on you needs (and your OS).
But starting from v20.12 only SofaPython3 will be supported.
For the moment STLIB is not compatible with SofaPython3 but the migration is ongoing, right @damien-marchaluniv-lille1-fr ?
Hugo18 September 2020 at 15 h 48 min #17183
- You must be logged in to reply to this topic.