title: Pyinstaller error when using multiple files
body: <p>I have the following question for Python 3.8.8. I have the following file called test2.py (I know the names of my files aren't great, sorry for that):</p>
  <pre class="lang-py prettyprint-override"><code># test2.py
  from tkinter import *
  from tkinter import ttk
  
  window = Tk()
  tab_control = ttk.Notebook(window)
  tab1 = ttk.Frame(tab_control)
  tab2 = ttk.Frame(tab_control)
  
  tab_control.add(tab1, text='First tab')
  tab_control.add(tab2, text='Second tab')
  lbl1 = Label(tab1, text= 'First label')
  lbl1.grid(column=0, row=0)
  lbl2 = Label(tab2, text= 'Second label')
  lbl2.grid(column=0, row=0)
  
  tab_control.pack(expand=1, fill='both')
  
  window.mainloop()
  </code></pre>
  <p>This code works just fine and if I type <code>pyinstaller --onefile --noconsole test2.py</code> the output is as expected (a working standalone file).</p>
  <p>However, I now change my test2.py code to:</p>
  <pre class="lang-py prettyprint-override"><code># test2.py
  from tkinter import *
  from tkinter import ttk
  from test import *
  
  window = Tk()
  tab_control = ttk.Notebook(window)
  tab1 = ttk.Frame(tab_control)
  tab2 = ttk.Frame(tab_control)
  
  tab_control.add(tab1, text='First tab')
  tab_control.add(tab2, text='Second tab')
  lbl1 = Label(tab1, text= text1)
  lbl1.grid(column=0, row=0)
  lbl2 = Label(tab2, text= text2)
  lbl2.grid(column=0, row=0)
  
  tab_control.pack(expand=1, fill='both')
  
  window.mainloop()
  </code></pre>
  <p>where test.py (again not a great name, sorry) is in the same folder as test2.py and reads:</p>
  <pre class="lang-py prettyprint-override"><code># test.py
  text1 = 'First label'
  text2 = 'Second label'
  </code></pre>
  <p>When I execute test2.py in my terminal it works perfectly, but <code>pyinstaller --onefile --noconsole test2.py</code> now gives a corrupt file (it is being generated, but when I try to execute it I get an error message saying &quot;Fatal error detected&quot; as title and &quot;Failed to execute script test2&quot; as message). Can somebody help me with this? Many thanks in advance!</p>
  <p>On another note, how could I fix this problem if test.py was in a subfolder? So for example test2.py is in a folder called Downloads, and test.py is in a folder called Subfunctions which is in turn a folder in Downloads. Again many thanks!</p>