I'd like to run two instances of IPython in Emacs at the same time, one with Python 2, and the other Python 3: is it something doable or there's something in the way
python.el is designed that would prevent it?
Yes, that's possible. Add the following code to your init-file (note that you might have to adapt
/usr/bin/ipython to point to appropriate executables for IPython 2 and IPython 3, respectively):
(defun run-python2 () (interactive) "Run IPython with Python 2." (let ((python-shell-buffer-name "Python 2")) (run-python "/usr/bin/ipython2 -i" nil t))) (defun run-python3 () "Run IPython with Python 3." (interactive) (let ((python-shell-buffer-name "Python 3")) (run-python "/usr/bin/ipython -i" nil t))) (global-set-key (kbd "C-c C-2") 'run-python2) (global-set-key (kbd "C-c C-3") 'run-python3)
With this in place you can launch IPython 2 via C-c C-2 and IPython 3 via C-c C-3. (You can of course change these bindings to your liking.)