title: pyinstaller cannot see configparser
body: <p>I am using configparser in a python application</p>
  
  <p>When I run the application</p>
  
  <pre><code>python main.py
  </code></pre>
  
  <p>it works. However if I use pyinstall to create a windows exe, the exe fails with the message</p>
  
  <pre><code>no module named 'configparser'
  </code></pre>
  
  <p>however as the screen shot shows, configparser does exist</p>
  
  <p>What is going on here?</p>
  
  <p>NB I do NOT get  the error if I remove __init__.py from the directory</p>
  
  <p><a href="https://i.stack.imgur.com/u6xAT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u6xAT.png" alt="enter image description here"></a></p>
  
  <p>[More info]</p>
  
  <p>This seems to be a 'sys.path' issue. If I copy configparser.py into my application directory, the problem moves on to another module that I'm calling</p>
  
  <p>Should I change my pyinstaller spec file?</p>
  
  <pre><code># -*- mode: python -*-
  a = Analysis(['main.py'],
               hiddenimports=[],
               hookspath=None,
               runtime_hooks=None)
  a.datas = list({tuple(map(str.upper, t)) for t in a.datas})
  pyz = PYZ(a.pure)
  exe = EXE(pyz,
            a.scripts,
            a.binaries,
            a.zipfiles,
            a.datas,
            name='test_imports.exe',
            debug=False,
            strip=None,
            upx=True,
            console=True)
  </code></pre>