Reputation: 71
I am trying to install rosbag
using pip:
pip install python-rosbag
But I am getting the following error:
(base) C:\Users\santhoshe.e\annotator-master>pip install python-rosbag Collecting python-rosbag ERROR: Could not find a version that satisfies the requirement python-rosbag (from versions: none) ERROR: No matching distribution found for python-rosbag
How can I install rosbag
in windows other than using pip
? Or the pip
I used is wrong?
Upvotes: 4
Views: 20770
Reputation: 81
I would suggest to install ros noetic (I installed the desktop-full version). See link: http://wiki.ros.org/noetic/Installation/Ubuntu
If you then source the setup script for ros via the following command:
source /opt/ros/noetic/setup.bash
Python should be able to import rosbag.
Upvotes: 1
Reputation: 41
pyrosbag
is actually a different package from rosbag
.
The right way should be
conda install -c conda-forge ros-rosbag
After that, you can run import rosbag
in Python.
Upvotes: 4
Reputation: 21
Try this to install pyrosbag using pip:
pip install pyrosbag
Now in the docs, the Usage page shows the import command as:
import pyrosbag
Upvotes: 1
Reputation: 405
Actually for rosbag, it is not very easy to install by using pip.
However you can use installation steps defined in ROS wiki.
But it is not done after installing rosbag, you should also add PYTHONPATH for the rosbag in your interpreter. Which can be done by simply selecting File>Settings>Project Interpreter and click the gear right next to your interpreter.
After that you will see two options : Add/ShowAll. Go with Show All and on the window that opened, on the right hand side, you will see +,-,..., a symbol that shows the paths for the selected interpreter (the symbol listed at the end)
Under these paths you should also define the path that you installed ros. For me, the path is :
/opt/ros/melodic/lib/python2.7/dist-packages
Upvotes: 0