PyCharm: How do I call frameworkpython so that it will use the framework python instead of the virtualenv python?
<p>I'm using matplotlib library with my virtualenv. If you use it this way, matplotlib will not plot the graph because it is not the python framework, but the python as per the virtualenv. This problem has been documented on the matplotlib website: <a href="http://matplotlib.org/faq/virtualenv_faq.html" rel="nofollow">http://matplotlib.org/faq/virtualenv_faq.html</a></p>

<p>You will end up with this error if you try running it with just the virtualenv python:</p>

<blockquote>
  <p>Python is not installed as a framework</p>
</blockquote>

<p><a href="http://i.stack.imgur.com/t5aco.png" rel="nofollow"><img src="http://i.stack.imgur.com/t5aco.png" alt="enter image description here"></a></p>

<p>I decided to use their second workaround which is to include the function PYTHONHOME into my bashrc. file. </p>

<p>I have included the function below into bashrc taken off the matplotlib website:</p>

<pre><code>function frameworkpython {
    if [[ ! -z "$VIRTUAL_ENV" ]]; then
        PYTHONHOME=$VIRTUAL_ENV /usr/local/bin/python "$@"
    else
        /usr/local/bin/python "$@"
    fi
}
</code></pre>

<p>Now, to run matplotlib successfully, I need to call <code>frameworkpython</code> instead of <code>python</code> to draw the graph. This is all good in my Terminal where I just type in the commands but I would rather use PyCharm to run my python code.</p>

<p>My question is, how do I get PyCharm to ran <code>frameworkpython</code> each time I press the green play button? The green play button just calls <code>python</code>. </p>

<p>I clicked on "Edit Configurations..." but cannot see how to change this. You can change the interpreters but frameworkpython is not an interpreter but rather a function within the bashrc file.</p>

<p><a href="http://i.stack.imgur.com/3TOIq.png" rel="nofollow"><img src="http://i.stack.imgur.com/3TOIq.png" alt="enter image description here"></a></p>

<p>You can set your Python interpreter in Pycharm. See:
<a href="https://www.jetbrains.com/help/pycharm/2016.1/configuring-available-python-interpreters.html" rel="nofollow">https://www.jetbrains.com/help/pycharm/2016.1/configuring-available-python-interpreters.html</a></p>

python osx python-2.7 matplotlib pycharm