4

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?

DeshDeep Singh
  • 1,817
  • 2
  • 23
  • 43
Bindu Machani
  • 71
  • 1
  • 1
  • 4

5 Answers5

3

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.

PeterG
  • 31
  • 4
1

I think it should be this:

pip install pyrosbag
EcSync
  • 842
  • 1
  • 6
  • 20
1

Try this to install pyrosbag using pip:

pip install pyrosbag

Now in the docs, the Usage page shows the import command as:

import pyrosbag
A.P
  • 21
  • 2
1

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.

Tun Kapgen
  • 81
  • 3
0

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

Kubra Altun
  • 365
  • 3
  • 12