title: importing class from another file gives error when working and no error when not working
body: <p>I am attempting to import a class named MainMenus from this file</p>
  <pre><code>B:\Programming\Python\RaceDash\src\UIModules\Menus.py
  </code></pre>
  <p>here is the code for the class</p>
  <pre><code>class MainMenus:
      def StartUp():
          #do stuff
      def MainMenu():
          #doing other stuff
  </code></pre>
  <p>I also have the _<em>init</em>_.py file in this path</p>
  <pre><code>B:\Programming\Python\RaceDash\src\UIModules\__init__.py
  </code></pre>
  <p>my main python file is here</p>
  <pre><code>B:\Programming\Python\RaceDash\src\Main.Py
  </code></pre>
  <p>and looks like this</p>
  <pre><code>from .UIModules.Menus import MainMenus
  
  def Main():
  
      MainMenus.StartUp()
  
      while True:
          MainMenus.MainMenu()
          userSelect = input(&quot;: &quot;)
  
  Main()
  </code></pre>
  <p>pylance gives no errors when but when I attempt to run the program I get this error:</p>
  <pre><code>ile &quot;b:\Programming\Python\RaceDash\src\Main.Py&quot;, line 1, in &lt;module&gt;
  from .UIModules.Menus import MainMenus
  ImportError: attempted relative import with no known parent package
  </code></pre>
  <p>When I remove the leading period pylance shows this error</p>
  <pre><code>Import &quot;UIModules.Menus&quot; could not be resolved
  </code></pre>
  <p>The application runs fine but I lose intellisense for any function from the other class.</p>
  <p>What could be causing this issue?</p>