Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ROS Kinetic - How to get roslaunch rosbridge_server with venv?

I have a project with venv that works just fine, but when we need to run roslaunch rosbridge_server rosbridge_websocket.launch it will result in the error below unless we deactivate venv.

process[rosbridge_websocket-2]: started with pid [10182] process[rosapi-3]: started with pid [10183] Failed to load Python extension for LZ4 support. LZ4 compression will not be available. Failed to load Python extension for LZ4 support. LZ4 compression will not be available. registered capabilities (classes): - <class 'rosbridge_library.capabilities.call_service.callservice'=""> - <class 'rosbridge_library.capabilities.advertise.advertise'=""> - <class 'rosbridge_library.capabilities.publish.publish'=""> - <class 'rosbridge_library.capabilities.subscribe.subscribe'=""> - <class 'rosbridge_library.capabilities.defragmentation.defragment'=""> - <class 'rosbridge_library.capabilities.advertise_service.advertiseservice'=""> - <class 'rosbridge_library.capabilities.service_response.serviceresponse'=""> - <class 'rosbridge_library.capabilities.unadvertise_service.unadvertiseservice'=""> Traceback (most recent call last): File "/opt/ros/kinetic/lib/rosbridge_server/rosbridge_websocket", line 44, in <module> from rosbridge_server import RosbridgeWebSocket, ClientManager File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosbridge_server/__init__.py", line 4, in <module> from .udp_handler import RosbridgeUdpSocket,RosbridgeUdpFactory File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosbridge_server/udp_handler.py", line 6, in <module> from twisted.internet.protocol import DatagramProtocol,Factory ImportError: No module named 'twisted'

I am assuming this is because there's no module named twisted installed in the virtual environment but it is installed on my computer. Following this hypothesis, this means that making roslaunch rosbridge_server rosbridge_websocket.launch work would require to install all the dependencies that it needs in venv? How would one go to do that?

ROS Kinetic - How to get roslaunch rosbridge_server with venv?

I have a project with venv that works just fine, but when we need to run roslaunch rosbridge_server rosbridge_websocket.launch it will result in the error below unless we deactivate venv.

process[rosbridge_websocket-2]: started with pid [10182]
 process[rosapi-3]: started with pid [10183]
 Failed to load Python extension for LZ4 support. LZ4 compression will not be available.
 Failed to load Python extension for LZ4 support. LZ4 compression will not be available.
 registered capabilities (classes):
   - <class 'rosbridge_library.capabilities.call_service.callservice'="">
   - <class 'rosbridge_library.capabilities.advertise.advertise'="">
   - <class 'rosbridge_library.capabilities.publish.publish'="">
   - <class 'rosbridge_library.capabilities.subscribe.subscribe'="">
   - <class 'rosbridge_library.capabilities.defragmentation.defragment'="">
   - <class 'rosbridge_library.capabilities.advertise_service.advertiseservice'="">
   - <class 'rosbridge_library.capabilities.service_response.serviceresponse'="">
   - <class 'rosbridge_library.capabilities.unadvertise_service.unadvertiseservice'="">
  - <class 'rosbridge_library.capabilities.call_service.CallService'>
 - <class 'rosbridge_library.capabilities.advertise.Advertise'>
 - <class 'rosbridge_library.capabilities.publish.Publish'>
 - <class 'rosbridge_library.capabilities.subscribe.Subscribe'>
 - <class 'rosbridge_library.capabilities.defragmentation.Defragment'>
 - <class 'rosbridge_library.capabilities.advertise_service.AdvertiseService'>
 - <class 'rosbridge_library.capabilities.service_response.ServiceResponse'>
 - <class 'rosbridge_library.capabilities.unadvertise_service.UnadvertiseService'>
Traceback (most recent call last):
   File "/opt/ros/kinetic/lib/rosbridge_server/rosbridge_websocket", line 44, in <module>
     from rosbridge_server import RosbridgeWebSocket, ClientManager
   File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosbridge_server/__init__.py", line 4, in <module>
     from .udp_handler import RosbridgeUdpSocket,RosbridgeUdpFactory
   File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosbridge_server/udp_handler.py", line 6, in <module>
     from twisted.internet.protocol import DatagramProtocol,Factory
 ImportError: No module named 'twisted'

'twisted'

I am assuming this is because there's no module named twisted installed in the virtual environment but it is installed on my computer. Following this hypothesis, this means that making roslaunch rosbridge_server rosbridge_websocket.launch work would require to install all the dependencies that it needs in venv? How would one go to do that?