title: Importing Rosbag in Python 3
body: <p>I'm trying to read rosbag files from Python 3.<br>
  I installed ROS2 (Eloquent Elusor), which should support Python 3.</p>
  
  <p>When I run</p>
  
  <pre><code>import rosbag
  bag = rosbag.Bag('test.bag')
  </code></pre>
  
  <p>from Python 2.7, it works.<br>
  When I try the same in Python 3, I get:</p>
  
  <pre><code>ModuleNotFoundError: No module named 'rosbag'
  </code></pre>
  
  <p>I also tried things like: <code>sudo apt install python-rosbag</code>, <code>sudo apt install python3-rospkg</code> and <code>pip3 install rospkg</code>, but they don't help.</p>
  
  <p>What should I do to open a rosbag file from Python 3?</p>
  
  <p>[EDIT]<br>
  This is the output after calling <code>pip3 install rospkg</code>:</p>
  
  <pre><code>Requirement already satisfied: rospkg in ./rosbag-env/lib/python3.6/site-packages
  Requirement already satisfied: catkin-pkg in ./rosbag-env/lib/python3.6/site-packages (from rospkg)
  Requirement already satisfied: distro in ./rosbag-env/lib/python3.6/site-packages (from rospkg)
  Requirement already satisfied: PyYAML in ./rosbag-env/lib/python3.6/site-packages (from rospkg)
  Requirement already satisfied: pyparsing in ./rosbag-env/lib/python3.6/site-packages (from catkin-pkg-&gt;rospkg)
  Requirement already satisfied: python-dateutil in ./rosbag-env/lib/python3.6/site-packages (from catkin-pkg-&gt;rospkg)
  Requirement already satisfied: docutils in ./rosbag-env/lib/python3.6/site-packages (from catkin-pkg-&gt;rospkg)
  Requirement already satisfied: six&gt;=1.5 in ./rosbag-env/lib/python3.6/site-packages (from python-dateutil-&gt;catkin-pkg-&gt;rospkg)
  </code></pre>