title: How to solve import error while running compiled file (.pyc)?
body: <p>I am using python 3.6.</p>
  <p>I have below directory structure:</p>
  <pre><code> test_run.py
  
   addition --&gt; add.py
  </code></pre>
  <p>I have test_run.py file which is importing one of the function called <code>add_values()</code> from <code>add.py</code> present inside <code>Addition</code> directory or package.</p>
  <p>Code for <code>test_run.py</code> and <code>add.py</code> is as below:</p>
  <p><code>test_run.py</code>:</p>
  <pre><code>from addition.add import add_values
   
  print(add_values(5,4))
  </code></pre>
  <p><code>add.py</code>:</p>
  <pre><code>def add_values(a,b):
      return (a+b)
  </code></pre>
  <p>I compiled everything using cpython compileall to create a .pyc file for each python file. Because I want to get rid of all python files and use only byte code files or compiled files.</p>
  <p><code>test_run.py</code> created <code>test_run.cpython-36.pyc</code><br />
  and <code>add.py</code> created <code>add.cpython-36.pyc</code>.</p>
  <p>Then I deleted actual python files (<code>test_run.py</code> and <code>add.py</code>) and ran compiled file <code>test_run.cpython-36.pyc</code> but it is giving me error:</p>
  <pre><code>ModuleNotFoundError: No module named 'addition.add' 
  </code></pre>
  <p>It works fine with source files (test_run.py), it fails only when I run bytecode file(test_run.cpython-36.pyc) without source files(after deleting the source files)</p>
  <p>Please guide me how do I get rid of original python files and use only byte code files?  I want to achieve complete obfuscation of code.</p>