title: How to troubleshoot import errors? Importing flask throws exception - ubuntu 18.04
body: <p>I am new to python programming and started trying to fool around with flask this morning. I installed flask using pip and it seemed to work as expected. However, when I went to the python shell and typed <code>import flask</code> I got the following error: </p>
  
  <pre><code> &gt;&gt;&gt; import flask
      Traceback (most recent call last):
        File "&lt;stdin&gt;", line 1, in &lt;module&gt;
        File "/usr/lib/python2.7/dist-packages/flask/__init__.py", line 17, 
     in &lt;module&gt;
           from werkzeug.exceptions import abort
        File "/usr/lib/python2.7/dist-packages/werkzeug/__init__.py", line 
      151, in &lt;module&gt;
         __import__('werkzeug.exceptions')
        File "/usr/lib/python2.7/dist-packages/werkzeug/exceptions.py", line 
      71, in &lt;module&gt;
         from werkzeug.wrappers import Response
        File "/usr/lib/python2.7/dist-packages/werkzeug/wrappers.py", line 
      27, in &lt;module&gt;
          from werkzeug.http import HTTP_STATUS_CODES, \
        File "/usr/lib/python2.7/dist-packages/werkzeug/http.py", line 23, 
      in &lt;module&gt;
          from email.utils import parsedate_tz
        File "/usr/lib/python2.7/email/utils.py", line 27, in &lt;module&gt;
          import random
        File "random.py", line 6, in &lt;module&gt;
          print(random.randint(1, 101)) 
          AttributeError: 'module' object has no attribute 'randint''
  </code></pre>
  
  <p>I uninstalled flask using pip and tried again. No change. I installed flask using apt, same problem I even tried it on python 2, same error message. the really weird part is that it is giving me errors from a python3 shell session I did earlier in the week - the import random for random.py part of the message at the very end. Why would it spit out messages that have nothing to do with the import flask message? </p>
  
  <p>It made me think that maybe I should see if a reboot would help, but no luck there either. </p>
  
  <p>How does one troubleshoot an issue like this? googling the error hasn't helped and I am running out of ideas. </p>
  
  <p>Thanks in advance</p>