title: Getting "ORA-28000: the account is locked" while connecting from Python to Oracle
body: <p>I have Python (3.8.3) and Oracle DB (11g Release 2 server) installed in my local system. Both of the software are working fine individually. I can run programs in python as well as I have tables created with data in Oracle DB which I am able to access through Oracle SQL Developer &amp; SQL Plus.
  But when I am trying to connect Oracle DB from python I am getting error as account locked. I have installed and executed import cx_Oracle successfully. But I am getting error when I am trying to execute below code.</p>
  <p><strong>1. Local initialization method -</strong>
  <em>connection = cx_Oracle.connect(&quot;oe/oracle@localhost:1522/orcl11g2&quot;)</em></p>
  <p><strong>2. Connecting through TNSNAMES.ORA -</strong>
  <em>connection = cx_Oracle.connect(&quot;oe&quot;, &quot;oracle&quot;, &quot;orcl11g2&quot;)</em></p>
  <p><strong>Error -</strong></p>
  <p><em>Traceback (most recent call last):
  File &quot;&quot;, line 1, in 
  cx_Oracle.DatabaseError: ORA-28000: the account is locked</em></p>
  <p><strong>My TNS Details -</strong></p>
  <p><strong>File location -</strong> <em>D:\app\Admin\product\11.2.0\dbhome_2\NETWORK\ADMIN</em></p>
  <p><em>ORCL11G2 =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522))
  (CONNECT_DATA =
  (SERVER = DEDICATED)
  (SERVICE_NAME = ORCL11G2)
  )
  )</em></p>
  <p>Please help me. Just let me know if you need to know anything more to guide me.</p>