title: How to make a module accessible by other modules
body: <p>I have two files <em>'mod1.py'</em> and <em>'mod2.py'</em>. </p>
  
  <p><em>mod1</em> requires request module to function. But  I have not imported them in the mod1 instead I have imported both request and mod1 module  in <em>mod2</em>. </p>
  
  <p>But </p>
  
  <p>I get an error <em>'name 'requests' is not defined'</em>. I know it works if i Import <em>'request'</em> module in <em>mod1</em> directly it works fine. But I have other modules I want to use that requires <em>'request'</em> module. <strong>So how do I import the module once and make in accessible to all the other modules ?.</strong> </p>
  
  <p><strong>mod1.py</strong></p>
  
  <pre><code>class getUrl():
      def __init__(self, url):
          self.url = url
  
      def grab_html(self):
          html = requests.get(self.url).text
          return html
  </code></pre>
  
  <p><strong>mod2.py</strong></p>
  
  <pre><code>import requests
  import mod1
  
  module1 = mod1.getUrl('https://www.wikipedia.org/')
  HTML = module1.grab_html()
  </code></pre>
  
  <p><strong>Edit: Complete error</strong></p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\camel\Desktop\test\mod2.py", line 5, in &lt;module&gt;
      HTML = module1.grab_html()
    File "C:\Users\camel\Desktop\test\mod1.py", line 6, in grab_html
      html = requests.get(self.url).text
  NameError: name 'requests' is not defined
  [Finished in 0.5s with exit code 1]
  [shell_cmd: python -u "C:\Users\guru\Desktop\test\mod2.py"]
  </code></pre>