Choose different PYTHONPATH in c9 IDE settings

The PYTHONPATH is the same for Python2 and Python3:


Due to this, even when Python3 interpreter is used, the package from /usr/local/lib/python2.7/dist-packages is imported because it is found first.

It would be nice to specify where the interpreter is installed for a particular python version and chose a different PYTHONPATH for each interpreter. A UI feature may be created to update PYTHONPATH with new value for different python version.

I installed Python3.6, I can’t get the IDE to use it even though I’m able to use it from terminal.

New important features for python are only available in python3.x but understandably, many system packages require python2.x so I’d say it is worthwhile to prioritize this feature.

1 Like

This is very important for python developers.

Can you guys follow pycharm/spyder way
of managing the path ?

This appears to have worked for me:
In C9 preferences I set “Python version:” to 3.
In C9 preferences I set “PYTHON PATH:” to “/usr/local/lib/python3.6/site-packages:/usr/local/lib/python2.7/dist-packages”
(BTW, the default directories don’t even exist, but I left the old 2.7 string anyway)
In .bashrc, I changed the python alias to “alias python=python36”.
Issued the reboot command to ensure new environment.