title: Unable to import array library in Python
body: <p>So I've started to learn Python recently and right now I've been trying to learn arrays, but unable to use the <em>array</em> function after importing the array library.</p>
  <p>I have tried four different methods to use the array function but failed successfully.</p>
  <p><strong>Method 1:</strong></p>
  <pre><code>import array
  nums = array.array('i', [])
  #rest of the code
  </code></pre>
  <p><em>Output 1:</em></p>
  <pre><code>Traceback (most recent call last):
  File &quot;array.py&quot;, line 2, in &lt;module&gt;
  import array
  File &quot;/home/prince/Desktop/python-basics/array.py&quot;, line 
  4, in &lt;module&gt;
  nums = array.array('i', [])
  TypeError: 'module' object is not callable
  </code></pre>
  <p><strong>Method 2:</strong></p>
  <pre><code>import array as a
  nums = a.array('i', [])
  #rest of the code
  </code></pre>
  <p><em>Output 2:</em></p>
  <pre><code>Traceback (most recent call last):
  File &quot;array.py&quot;, line 2, in &lt;module&gt;
  import array as a
  File &quot;/home/prince/Desktop/python-basics/array.py&quot;, line 
  4, in &lt;module&gt;
  nums = a.array('i', [])
  AttributeError: partially initialized module 'array' has 
  no attribute 'array' (most likely due to a circular 
  import)
  </code></pre>
  <p><strong>Method 3:</strong></p>
  <pre><code>from array import array
  nums = array('i', [])
  #rest of the code
  </code></pre>
  <p><em>Output 3:</em></p>
  <pre><code>Traceback (most recent call last):
  File &quot;array.py&quot;, line 2, in &lt;module&gt;
  from array import array
  File &quot;/home/prince/Desktop/python-basics/array.py&quot;, line 
  2, in &lt;module&gt;
  from array import array
  ImportError: cannot import name 'array' from partially 
  initialized module 'array' (most likely due to a circular 
  import) (/home/prince/Desktop/python-basics/array.py)
  </code></pre>
  <p><strong>Method 4:</strong></p>
  <pre><code>from array import *
  nums = array('i', [])
  </code></pre>
  <p><em>Output 4:</em></p>
  <pre><code>Traceback (most recent call last):
  File &quot;array.py&quot;, line 2, in &lt;module&gt;
  from array import *
  File &quot;/home/prince/Desktop/python-basics/array.py&quot;, line 
  4, in &lt;module&gt;
  nums = array('i', [])
  NameError: name 'array' is not defined
  </code></pre>
  <p>And after compilation, <strong>every time</strong> another folder is automatically created in my directory whose name is : <strong><strong>pycache</strong></strong></p>
  <p>And inside that folder there is a file named: <strong>array.cpython-38.pyc</strong> which I am unable to open. My editor says that it is because it either uses binary or unsupported text.</p>
  <p>A few additional details if that helps:</p>
  <p><strong>Text Editor I Used:</strong> <em>VS Code</em></p>
  <p><strong>My OS:</strong>  <em>Ubuntu 20.04LTS</em></p>
  <p><strong>Python Version:</strong> <em>3.8.5</em></p>