I do have python3 on my laptop.
$ sudo find / -name "python3" | python3-locations.org
(partial list of locations)
/usr/local/bin/python3
/usr/lib/python3
/usr/share/doc/python3
/usr/share/lintian/overrides/python3
/usr/share/bash-completion/completions/python3
/usr/share/python3
/usr/bin/python3
/etc/python3
When I
$ emacs 25.2.1
C-x C-f foo.py
apparently I enter major mode Python
C-c C-p ; start interpreter
I get:
Python 2.7.15+ (default, Nov 27 2018, 23:36:35)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> python.el: native completion setup loaded
>>>
Process Python finished
Python 2.7.15+ (default, Nov 27 2018, 23:36:35)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> python.el: native completion setup loaded
>>>
I expect that I need to add some expression in .emacs.d/init.el
.
I have done some research into this, and found a recommendation to add this expression
(add-hook 'python-mode-hook #'(lambda () (setq py-python-command "python3")))
to that file. I restarted emecs with no errors, but I still get Python2.7.
What can I do?