title: unable to run a python file because of Module not found error despite sourcing the pythonpath
body: <p>I have been trying to run a python file using rosrun command but unfortunately I am having this module not found error because of a package named rospkg. Until a day before yesterday, it was all working fine but yesterday, ubuntu18.04 has got some updates out of which an update for ubuntu base was also present, since that update I am having this error.</p>
  
  <p>I have tried to check whether I have installed the respective python-rospkg and its says I already have the latest version. I have also using 
     <code>echo $PYTHONPATH</code> 
  to check the sourced paths and they are sourced correct, I am not sure whats causing this error.</p>
  
  <p>the error is as follows 
        <code>Traceback (most recent call last
          File 
         "/home/microbot/catkin_ws/src/spider/spider_control/control.py", 
         line 5, in &lt;module&gt;
         import roslib
         File "/opt/ros/melodic/lib/python2.7/dist- 
         packages/roslib/__init__.py", line 50, in &lt;module&gt;
          from roslib.launcher import load_manifest
         File "/opt/ros/melodic/lib/python2.7/dist- 
         packages/roslib/launcher.py", line 42, in &lt;module&gt;
         import rospkg
        ModuleNotFoundError: No module named 'rospkg'</code></p>
  
  <p>The shebang for my is as follows,
        <code>#!/usr/bin/python3</code>
  When i try to run the file by changing the shebang to 
        <code>#!/usr/bin/python2.7</code>
  I get the following error 
         <code>Traceback (most recent call last):
          File 
          "/home/microbot/catkin_ws/src/spider/spider_control/control.py", 
           line 3, in &lt;module&gt;
           import tensorflow as tf
           ImportError: No module named tensorflow</code></p>
  
  <p>I have installed tensorflow version 1.14 using pip installation. Can anyone please help me solving this error. Thanks in advance</p>
  
  <p>edit:</p>
  
  <p>I have manually tried to set the python path to <code>/usr/lib/python2.7/dist-packages</code> as when I tried to install python-rospkg, it says the its already instaled in that location. Doing that I am having error importing tensorflow and the error is </p>
  
  <pre><code> `Traceback (most recent call last):
    File 
   "/home/microbot/catkin_ws/src/spider/spider_control/control.py", line 
    3, in &lt;module&gt;
   import tensorflow as tf
   File "/home/microbot/.local/lib/python3.6/site- 
   packages/tensorflow/__init__.py", line 22, in &lt;module&gt;
   import inspect as _inspect
   File "/usr/lib/python3.6/inspect.py", line 41, in &lt;module&gt;
   import linecache
   File "/usr/lib/python3.6/linecache.py", line 11, in &lt;module&gt;
   import tokenize
   File "/usr/lib/python3.6/tokenize.py", line 33, in &lt;module&gt;
   import re
   File "/usr/lib/python3.6/re.py", line 142, in &lt;module&gt;
  class RegexFlag(enum.IntFlag):
  AttributeError: module 'enum' has no attribute 'IntFlag'
  Error in sys.excepthook:`
  </code></pre>