Recognizing cx_Oracle install within PyDev
<p>I am on Windows 10 Pro 64-bit Anniversary Edition using Python 3.5.2 (Anaconda 4.1.1). I download the latest Oracle 12c Instant Client <code>instantclient-basic-windows.x64-12.1.0.2.0.zip</code> and <code>instantclient-sdk-windows.x64-12.1.0.2.0.zip</code> into <code>C:\instantclient</code> and put <code>C:\instantclient</code> on my <code>PATH</code>. Then I download the installer <code>cx_Oracle-5.2.1-12c.win-amd64-py3.5.exe</code> <a href="https://pypi.python.org/pypi/cx_Oracle/5.2.1" rel="nofollow">directly from <code>PyPI</code></a>.</p>

<p>Now I can start an Anaconda <code>python</code> prompt and type <code>import cx_Oracle</code> and it is successful.</p>

<pre><code>&gt;&gt;&gt; import cx_Oracle
&gt;&gt;&gt;
</code></pre>

<p>By when I go into my PyDev installation on Eclipse Neon (4.6), the <code>import cx_Oracle</code> line in my source file still shows an error as an unresolved import.</p>

<ul>
<li>I went into <strong>Windows > Preferences > PyDev > Interpreters > Python Interpreter</strong> and removed the Anaconda interpreter (<code>C:\bin\anaconda3\python.exe</code>) and added it back. I restarted Eclipse, but no luck.</li>
<li>I issued a <strong>Project > Clean</strong> on all my projects and restarted Eclipse. It still shows <code>import cx_Oracle</code> as an unresolved import.</li>
</ul>

<p>How can I get <code>PyDev</code> to see my <code>cx_Oracle</code> package installation?</p>

<p>Note that there are a lot of supposed answers that do not work for me; I've tried all the suggestions, as indicated above.</p>

<ul>
<li><a href="http://stackoverflow.com/q/26235307/421049">PyDev does not recognize imports</a></li>
<li><a href="http://stackoverflow.com/q/3732093/421049">How To Make Eclipse Pydev Plugin Recognize Newly Installed Python Modules?</a></li>
<li><a href="http://stackoverflow.com/q/8318103/421049">Force eclipse to reload Python modules</a></li>
<li><a href="http://stackoverflow.com/q/3610272/421049">pydev doesn&#39;t find python library after installation</a></li>
</ul>

<p>You can try this (after the steps that you already report in your question)</p>

<ol>
<li><p>Check if the installation in PyDev is ok (besides showing an error marker for <code>import cx_Oracle</code>)</p>

<pre><code>import cx_Oracle

conn = cx_Oracle.connect('hr/hr@pdborcl')
cur = conn.cursor()
cur.execute('select 13 from dual')
for r in cur.fetchall():
    print(r)
</code></pre>

<p>If this works, and prints <code>(13,)</code> the installation is correct. Likely some part of completion could work as well. In addition, Shift+Click on <code>cx_Oracle</code> should report <code>The definition of ... was found at ...</code>.</p></li>
<li><p>Go to  <strong>Windows > Preferences > PyDev > Interpreters > Python Interpreter</strong> and on the tab <strong>Forced builtins</strong> add <code>cx_Oracle</code></p>

<p>After rebuilding the project, the error markers on the import should go away. (In the little test program I just did a trivial edit and saved.)</p></li>
</ol>

<p>For the record: </p>

<pre><code>Eclipse Version: 4.6.0 (Neon)
PyDev Version: 5.2.0
Python: 3.5.2 (from a virtualenv)
</code></pre>

python windows anaconda pydev cx-oracle