Change .so, .pyc, and .py search order in python search path
<p>According to this post, python prioritizes .so and .pyc before .py files when searching for modules. Is there some way to make .py searched first?</p>

<p><a href="http://stackoverflow.com/questions/6584457/what-is-the-precedence-of-python-compiled-files-in-imports">What is the precedence of python compiled files in imports?</a></p>

<p>My use case is that i have libraries that have .py files but are compiled to .pyc using a different bit size than my ipython notebook. I'd like to use ipython notebook on those libraries without messing up my dev environment</p>

<p>You shouldn't be using the same package installations with two different version of the python interpreter, since they're bytecode won't be compatible.  You should install the packages to each python installation separately.</p>

<p>In Python 3, this is less of an issue, since the interpreter version is hashed into the bytecode filename inside a <code>__pycache__</code> directory, so multiple interpreters can generate bytecode for the same installation without stepping on each other.</p>

<p>You can also run python with the <a href="https://docs.python.org/2/using/cmdline.html#cmdoption-B" rel="nofollow"><code>-B</code> flag</a>, or set the <code>PYTHONDONTWRITEBYTECODE</code> environment variable, to tell python not to compile .pyc files</p>

python import