1 year ago
#360177
lyph10010101
Why can't I import the Stable Baselines 3 module in CoppeliaSim using Python?
I'm trying to test some of the Stable Baselines 3 Deep Reinforcement Learning algorithms in CoppeliaSim version 4.3.0 (the one that lets you create scripts in Python). I can import other modules such as numpy, gym and torch without errors. However, when I do the following import, I get an error and the simulation crashes:
from stable_baselines3 import PPO
This is the error I get:
[/robot@childScript:error] ...es/CoppeliaRobotics/CoppeliaSimEdu/lua/pythonWrapper.lua:334: The Python interpreter could not handle the wrapper script (or communication between the launched subprocess and CoppeliaSim could not be established via sockets). Make sure that the Python modules 'cbor' and 'zmq' are properly installed, e.g. via:
$ /path/to/python -m pip install pyzmq
$ /path/to/python -m pip install cbor
stack traceback:
[C]: in function 'error'
...es/CoppeliaRobotics/CoppeliaSimEdu/lua/pythonWrapper.lua:334: in function 'initPython'
...es/CoppeliaRobotics/CoppeliaSimEdu/lua/pythonWrapper.lua:225: in function 'sysCall_init'
I have already installed the cbor and zmq modules. I installed the Stable Baselines 3 package using the following command:
pip install stable-baselines3[extra]
I added the following code below the #python comment at the beginning of the script, but it didn't solve my problem.
#luaExec additionalIncludePaths={'C:/Python310/Lib/site-packages'}
I run my Python code in Visual Studio Code and it imports the Stable Baselines 3 module and works perfectly.
I don't know what else to do. Please, help.
python
import
module
robotics
stable-baselines
0 Answers
Your Answer