0

When I do `M-x run-python' it opens an interpreter but it is python 2.7.

I would like the command `M-x run-python' to open it as is in my anaconda3 installation. I want to do this, as none of my packages are importable currently. So I followed advice from "this answer" and added the following to my /.emacs.d/init.el file.

(setq python-python-command "/home/eghx/anaconda3/bin/python")

It doesn't work. I only end up opening python 2.7

Furthermore, anaconda's python works with spyder (IDE), works in my terminal and everywhere else except by default with emacs.

As you can tell I am a noob and would greatly appreciate any help. Thanks

Specs

Ubuntu 16 recent install, Emacs 27.0.5, Anaconda 3

4
  • 1
    What is $ in your code? That probably shouldn't be in your Emacs config. Commented Apr 12, 2018 at 22:43
  • Also, Emacs 27.0.5 doesn't exist. The latest release is currently Emacs 25.3, and there are pretests for Emacs 26.1. Commented Apr 12, 2018 at 22:45
  • 1
    python-python-command is for "loveshack python.el", which was the python mode that shipped with older emacs versions. "Gallina python.el" is the one that's in current versions. emacswiki.org/emacs/PythonProgrammingInEmacs#toc2 Commented Apr 12, 2018 at 23:04
  • @Chris edited the $ out. Sorry, my bad. @Chris, this is the output of emacs --version 'GNU Emacs 27.0.50'. I used this to install the latest version of emacs. @jpkotta that was it. I didn't know that. Thank You for the python emacs wiki. :) Commented Apr 13, 2018 at 17:32

1 Answer 1

1

check the path to Python3 or better to IPython3 in the shell:

$ which python3

add the path to init file:

(setq python-shell-interpreter "/path/to/ipython3")
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.