title: "Most likely due to circular import" in Python
body: <pre class="lang-py prettyprint-override"><code>import threading
  import time
  
  start = time.perf_counter()
  
  def do_something():
      print(&quot;Sleeping in 1 second&quot;)
      time.sleep(1)
      print(&quot;Done sleeping&quot;)
  
  t1 = threading.Thread(target=do_something)
  t2 = threading.Thread(target=do_something)
  
  finish = time.perf_counter()
  print(f&quot;Finished in {round(finish-start,1)} seconds(s) &quot;)
  </code></pre>
  <p>Does anyone know why this piece of code returns this error when run and how to fix it?</p>
  <pre class="lang-none prettyprint-override"><code>Traceback (most recent call last):
    File &quot;c:/Users/amanm/Desktop/Python/Python Crash Course/threading.py&quot;, line 1, in &lt;module&gt;
      import threading
    File &quot;c:\Users\amanm\Desktop\Python\Python Crash Course\threading.py&quot;, line 12, in &lt;module&gt;
      t1 = threading.Thread(target=do_something)
  AttributeError: partially initialized module 'threading' has no attribute 'Thread' (most likely due to a circular import) 
  </code></pre>
  <p>When I run this code in normal IDLE it seems to work but it doesn't work in Visual Studio Code.</p>