title: Importing second file in already imported file causing errors?
body: <p>Okay so I have googled this a <em>ton</em> and tried the solutions listed on stackoverflow... but none of them have worked.</p>
  
  <p>I am in anaconda, if that matters. I have a python file called 'mainwithai.py'. In that file, I do:</p>
  
  <pre><code>from SAI import AI_Player
  </code></pre>
  
  <p>Which works fine. SAI.py is in the same directory as mainwithai. Now, in that same directory, is a file called "getboards.py".</p>
  
  <p>I tried to import this in SAI, <em>not</em> in mainwithai, in the same way, and it failed. I tried it a couple different ways and it fails, based on the different answers I've seen, here are a few:</p>
  
  <pre><code>from . import getboards
  import getboards
  from .. import getboards
  from getboards import *
  </code></pre>
  
  <p>getboards has no classes, if that matters (SAI.py has a class). Just a collection of functions and some random dictionaries those functions need. It likewise doesn't matter if I try the import in mainwithai or SAI, same errors.</p>
  
  <p>Why does SAI work, and getboards fails? I see that there are .pyc files for mainwithai and sai in the folder; do I need one of those for getboards too? </p>
  
  <p>I've read something about <code>__init__.py</code>, but it sounds like that's for something entirely different than what I'm trying to do; I just want to hit f5 on mainwithai and have it go, not make a package. </p>
  
  <p>EDIT:
  Adding output of ls</p>
  
  <pre><code> Volume in drive D is YSTORAGE
   Volume Serial Number is 60BA-9F15
  
   Directory of D:\AllStuff\writtenworks\StrategoProject
  
  07/27/2018  11:42 AM    &lt;DIR&gt;          .
  07/27/2018  11:42 AM    &lt;DIR&gt;          ..
  01/26/2018  10:14 AM                66 .gitattributes
  01/29/2018  11:05 AM                70 .gitignore
  11/06/2018  09:17 AM    &lt;DIR&gt;          __pycache__
  12/29/2017  12:26 AM             7,812 AI.py
  01/30/2018  11:56 AM    &lt;DIR&gt;          AI_Mode
  01/02/2018  03:22 PM    &lt;DIR&gt;          backups
  12/29/2017  12:42 AM               231 conf.cfg
  01/31/2018  09:52 AM    &lt;DIR&gt;          Database
  12/31/2017  09:45 PM               336 empty.txt
  12/31/2017  09:28 PM               336 gamestate.txt
  11/13/2018  02:57 PM            16,352 getboards.py
  12/31/2017  06:27 PM           125,862 gurobi.log
  01/26/2018  10:14 AM            35,119 LICENSE
  11/13/2018  03:41 PM            34,443 mainwithai.py
  01/02/2018  11:11 PM            20,259 mainwithai.pyc
  11/08/2018  02:06 PM            16,268 mcts.py
  01/24/2018  01:11 PM                 0 mintemps.txt
  12/29/2017  04:26 PM             1,322 model.ilp
  11/08/2018  09:11 AM         8,252,424 neuralstrategoALL.h5
  12/31/2017  06:08 PM             6,827 optimization_setup.py
  01/29/2018  10:40 AM    &lt;DIR&gt;          optimizedsetups
  01/26/2018  10:14 AM                18 README.md
  09/08/2017  03:05 PM    &lt;DIR&gt;          resources
  11/13/2018  03:40 PM            12,747 SAI.py
  01/26/2018  01:08 PM             5,666 SAI.pyc
  11/06/2018  10:51 AM             8,872 SAIbackup.txt
  11/09/2018  11:10 AM             4,226 strategoneural.py
  12/31/2017  09:06 PM               337 testtest.txt
  12/31/2017  09:00 PM               336 texttext.txt
  11/07/2018  04:59 PM             4,992 xmlparse2.py
                24 File(s)      8,554,921 bytes
                 8 Dir(s)  20,052,148,224 bytes free
  </code></pre>
  
  <p>EDIT 2: here are all the imports at the top of all three files:</p>
  
  <p>mainwithai:</p>
  
  <pre><code># -*- coding: utf-8 -*-
  import configparser
  import sys, time, pygame
  from pygame.locals import *
  import random
  import re
  from SAI import AI_Player
  </code></pre>
  
  <p>SAI:</p>
  
  <pre><code># -*- coding: utf-8 -*-
  import random
  import numpy as np
  import keras
  from keras.models import load_model
  from copy import copy
  import re
  </code></pre>
  
  <p>getboards:</p>
  
  <pre><code># -*- coding: utf-8 -*-
  import numpy as np
  from copy import copy, deepcopy
  </code></pre>
  
  <p>I don't import anywhere but at the top, that's all of them I checked (I searched the files as a matter of course though), so I don't think it's a circular reference. The only thing they have in common is that getboards has a dictionary with the same name as SAI, but other than that I checked all the function names even; nothing.</p>
  
  <p>EDIT 3: Stacktrace of putting <code>import getboards</code> in SAI.py</p>
  
  <pre><code>runfile('D:/AllStuff/writtenworks/StrategoProject/SAI.py', wdir='D:/AllStuff/writtenworks/StrategoProject')
  Traceback (most recent call last):
  
    File "&lt;ipython-input-895-2df6678e9989&gt;", line 1, in &lt;module&gt;
      runfile('D:/AllStuff/writtenworks/StrategoProject/SAI.py', wdir='D:/AllStuff/writtenworks/StrategoProject')
  
    File "C:\Users\ylwaller\AppData\Local\Continuum\anaconda2\envs\sdev3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 678, in runfile
      execfile(filename, namespace)
  
    File "C:\Users\ylwaller\AppData\Local\Continuum\anaconda2\envs\sdev3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 106, in execfile
      exec(compile(f.read(), filename, 'exec'), namespace)
  
    File "D:/AllStuff/writtenworks/StrategoProject/SAI.py", line 8, in &lt;module&gt;
      import getboards
  
  ModuleNotFoundError: No module named 'getboards'
  </code></pre>