title: configparser.NoSectionError:No section:'XXX'
body: <p>I want to configure a config. ini and read it. When I run the code in pycharm, it's okay and it returns the result normally. But when I use pyinstaller to package .PY into an .EXE file, it will report an error:</p>
  
  <p><code>Congparser.NosectionError: No section:'config'</code></p>
  
  <p>If there are any suggestions, I would be very grateful.
  By the way, the. EXE file and. INI file are in the same folder,
  I use Python3.7 on Windows10</p>
  
  <p>I'm a Python rookie. I don't know how to solve the error in cmd. I try to output the path in pycharm. The result is very normal.</p>
  
  <pre><code># coding = gbk
  
  import  configparser
  
  import os
  
  curpath = os.path.dirname(os.path.realpath(__file__))
  cfgpath = os.path.join(curpath, "config.ini")
  print(cfgpath)
  print(os.path.realpath(__file__))
  
  
  conf = configparser.ConfigParser()
  
  
  conf.read(cfgpath)
  
  
  items = conf.items('config')
  l2 = [items[0][1],items[1][1],items[2][1],items[3][1]]
  print(items)
  print(l2)
  </code></pre>
  
  <p>Results in pycharm：</p>
  
  <pre><code>E:\untitled\venv\Custom_formula\config.ini
  E:\untitled\venv\Custom_formula\config_data.py
  [('server', '127.0.0.1'), ('user', 'sa'), ('pwd', '123456'), ('db', 'test')]
  ['127.0.0.1', 'sa', '123456', 'test']
  </code></pre>
  
  <p>Results in CMD:</p>
  
  <pre><code>Traceback (most recent call last):
    File "config_data.py", line 25, in &lt;module&gt;
    File "configparser.py", line 848, in items
  configparser.NoSectionError: No section: 'config'
  [9080] Failed to execute script config_data
  </code></pre>