Home › Forum › SOFA › Using SOFA › Doubts: Complie SofaRobots and Sofapython3
Tagged: 64_bits, Complie SoftRobots, Linux_ubuntu, Plugin_SoftRobots, SOFA_2006
- This topic has 3 replies, 4 voices, and was last updated 4 years, 1 month ago by Damien Marchal.
-
AuthorPosts
-
12 September 2020 at 05:00 #17128CaiBlocked
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:35 #17163HugoKeymasterHi @mingxuecai
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 ?
Best wishes,
Hugo
18 September 2020 at 15:48 #17183sescaidaBlocked1 October 2020 at 22:05 #17246Damien MarchalBlockedHi all,
We decided to work directly in the master branch of STLIB. There is now a python3 directory there with preliminary work. Far from finished, but if some want to help they are welcome.
Regards,
DM. -
AuthorPosts
- You must be logged in to reply to this topic.