title: Python: ModuleNotFoundError: No module named "core" found while running the installed package
body: <p>Here is my package structure:</p>
  <pre><code>upgradehost
      |
      |_ _ upgradehost
      |   |
      |   |_ app.py 
      |   |
      |   |_ core.py
      |   |
      |   |_ stable.py
      |   |
      |   |_ __init__.py
      |
      |_ _ doc
      |
      |_ _ test
      |
      |_ _ setup.py
      |
      |_ _ __init__.py
  </code></pre>
  <p>My app.py contains following import:</p>
  <pre><code>from core import customlogger, upgradeHost  
  from stable import vm_upgarde, disk_upgrade
  </code></pre>
  <p>My setup.py conains the following as parameters to setuptools.setup()</p>
  <pre><code>packages=['upgradehost'],
  py_modules=['upgradehost.core', 'upgradehost.stable'],  # I added this after getting the &quot;ModuleNotFoundError: No module named 'core'&quot; the first time.
  </code></pre>
  <p>Then I tried to install the package.</p>
  <pre><code>&gt; python setup.py install
  
  creating build\bdist.win32\egg\upgradehost
  copying build\lib\upgradehost\1.py -&gt; build\bdist.win32\egg\upgradehost
  copying build\lib\upgradehost\app.py -&gt; build\bdist.win32\egg\upgradehost
  copying build\lib\upgradehost\core.py -&gt; build\bdist.win32\egg\upgradehost
  copying build\lib\upgradehost\stable.py -&gt; build\bdist.win32\egg\upgradehost
  copying build\lib\upgradehost\__init__.py -&gt; build\bdist.win32\egg\upgradehost
  .
  .
  .
  byte-compiling build\bdist.win32\egg\upgradehost\app.py to app.cpython-38.pyc
  byte-compiling build\bdist.win32\egg\upgradehost\core.py to core.cpython-38.pyc
  byte-compiling build\bdist.win32\egg\upgradehost\stable.py to stable.cpython-38.pyc
  .
  .
  .
  Installed c:\users\may\appdata\local\programs\python\python38-32\lib\site-packages\upgradehost-0.0.1-py3.8.egg
  Processing dependencies for upgradehost==0.0.1
  Finished processing dependencies for upgradehost==0.0.1
  </code></pre>
  <p>Then I try to run the application from the \Python\Python38-32\Scripts directory.</p>
  <pre><code>&gt; upgradehost -h 
  
  Traceback (most recent call last):
    File &quot;C:\Users\may\AppData\Local\Programs\Python\Python38-32\Scripts\upgradehost-script.py&quot;, line 11, in &lt;module&gt;
      load_entry_point('upgradehost==0.0.1', 'console_scripts', 'upgradehost')()
    File &quot;C:\Users\may\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pkg_resources\__init__.py&quot;, line 489, in load_entry_point
      return get_distribution(dist).load_entry_point(group, name)
    File &quot;C:\Users\may\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pkg_resources\__init__.py&quot;, line 2852, in load_entry_point
      return ep.load()
    File &quot;C:\Users\may\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pkg_resources\__init__.py&quot;, line 2443, in load
      return self.resolve()
    File &quot;C:\Users\may\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pkg_resources\__init__.py&quot;, line 2449, in resolve
      module = __import__(self.module_name, fromlist=['__name__'], level=0)
    File &quot;&lt;frozen zipimport&gt;&quot;, line 259, in load_module
    File &quot;C:\Users\may\AppData\Local\Programs\Python\Python38-32\lib\site-packages\upgradehost-0.0.1-py3.8.egg\upgradehost\app.py&quot;, line 6, in &lt;module&gt;
  ModuleNotFoundError: No module named 'core'
  </code></pre>
  <p>I need your kind help to let me know what is happening here and how this can be resolved.
  I am on Windows 10 and Python 3.8</p>