Getting cx_Oracle with correct case using conda
<p>I'm new to Python. I'm using the Anaconda 4.1.1 (Python 3.5.2) distribution on Ubuntu. I started working on a project that uses <a href="http://cx-oracle.sourceforge.net/" rel="nofollow"><code>cx_Oracle</code></a>. O could of course install <code>cx_Oracle</code> using <code>pip</code>.</p>

<pre><code>pip install cx_Oracle
</code></pre>

<p>But everyone seems to be saying that Anaconda's <code>conda</code> is a much better package manager, virtual environment manager, and dependency manager that <code>pip</code> and <code>virtualenv</code> put together. I'd prefer to just use <code>conda</code> for managing everything.</p>

<p>So I made a <code>requirements.txt</code> file (some of my teammates will still be using <code>pip</code> and <code>virtualenv</code>) with the following line. (I want to support Python 3.5, so I need <code>cx_Oracle</code> 5.2.1, the current latest.)</p>

<pre><code>cx_Oracle==5.2.1
</code></pre>

<p>Then I tell <code>conda</code> to create a virtual environment <code>foobar</code>:</p>

<pre><code>conda create -n foobar --file requirements.txt
</code></pre>

<p>This fails; unfortunately <code>cx_Oracle</code> 5.2.1 is not yet in the Continuum conda repository (even though half the year has passed since it was released). However there are several channels (e.g. <code>mgckind</code>) purporting to supply version 5.2.1. There's just one problem: all the channels are supplying <code>cx_oracle</code> and not <code>cx_Oracle</code> (note the case difference). So this won't work:</p>

<pre><code>conda create -n foobar -c mgckind --file requirements.txt
</code></pre>

<p>Even if I specify a channel as in the example above, and even though <code>requirements.txt</code> clearly says <code>cx_Oracle</code>, <code>conda</code> brings down <code>cx_oracle</code> with a lowercase <code>o</code>. Because Python module imports are apparently case sensitive, all my tests fail because they can't find <code>cx_Oracle</code> with an uppercase <code>O</code>.</p>

<p>Am I missing something simple here because I'm new to Python? Or is Anaconda really both behind the times and incompatible with <code>cx_Oracle</code>, meaning I'll have to use <code>pip install</code> and bring it down from PyPI?</p>

<p>If there is really a case difference, is this situation common on Conda vs PiPY? Is it a Conda policy to name things only in lowercase? How do others deal with the discrepancy?</p>

<p>The conda package name does not influence how your <code>import</code> the code in python.  Looking at the linux-64 package <a href="https://anaconda.org/anaconda/cx_oracle/files" rel="nofollow">here</a> for example, while the package name is <code>cx_oracle</code> to conform to conda ecosystem standards, in python you <em>must</em> import that package with <code>import cx_Oracle</code>.  There are many examples of python packages on PyPI where the package name is different than how the package is imported in python code.  Just one of those python quirks I guess.</p>

python pip anaconda cx-oracle conda