When setting up my emacs for a new work environment, I am unable to get the elpy configuration to correctly use python 3. I have installed all of the required packages in /usr/local/bin and have installed them using python3.

Right now, when I run elpy-config I am getting the following:

Virtualenv........: None
RPC Python........: 2.7.6 (/usr/bin/python)
Interactive Python: python (/usr/bin/python)
Emacs.............: 24.5.1
Elpy..............: 1.9.0
Jedi..............: 0.9.0
Rope..............: Not found (0.10.2 available)
Importmagic.......: 0.1.3
Autopep8..........: 0.1.3
Syntax checker....: Not found (pyflakes)

I would like to have RPC Python be ipython3 and the same for the interactive. For the purposes of this question, assume my .emacs file is blank.

  • I hope you mean /usr/local/bin
    – mmmmmm
    Commented Oct 19, 2015 at 21:54

3 Answers 3


You can conffigure elpy-rpc-python-command. If you want Python3 you can set it like this.

(setq elpy-rpc-python-command "python3")


Create python3 virtualenv using virtualenvwrapper from terminal

$ mkvirtualenv test -p /usr/bin/python3

and then install required packages

$ pip install rope jedi importmagic autopep8 flake8

Now go to emacs, activate virtualenv and run M-x elpy-config

M-x pyvenv-workon test
M-x elpy-config

If you want to have ipython as your REPL, you can put this function in you config



(elpy-use-ipython "python3")

Note: elpy-use-ipython is deprecated. Use

(setq python-shell-interpreter "ipython3"
      python-shell-interpreter-args "-i")

or ipython based on your version.

  • Doing this and then going back into the config says that python3 is not recognized and Jedi, Importmagic, and autopep8 are now marked as not found
    – adam
    Commented Sep 15, 2015 at 18:12
  • You have to set full path to python3. If you are using ubuntu, you can use /usr/bin/python3. In any case, it is better if you create python3 virtual env, activate that env and install those packages. Updated answer Commented Sep 15, 2015 at 18:16
  • 2
    If you have ipython installed for Python2 and ipython3 installed for Python3, then you can use the ipython3 REPL with (elpy-use-ipython "ipython3") assuming that's in your path. Commented Jun 1, 2016 at 15:19
  • 1
    (elpy-use-ipython) is deprecated; see elpy.readthedocs.io/en/latest/ide.html#interpreter-setup Commented Jun 1, 2018 at 15:27
  • The above made it worse as adam stated. I made a virtual env and did all the imports. elpy is not finding anything and insistse on stil suping elpy/repc-venv/bin/python as well which is what it was complaining about in the first place
    – sjatkins
    Commented Jul 4, 2020 at 19:55

You can solve this by modifying the python shell configuration from python to python3 in elpy-config

  1. M-x elpy-config to enter the configuration page of elpy
  2. if you scroll down you will see groups with [+] signs, toggle the Python one and find the shell interpreter option: Option Python Shell Interpreter is the one you are looking for.
  3. If you click (or Enter in terminal version) on the Option button you will be able to edit the part "python" to "python3"
  4. Apply and save, and restart emacs
  • I did this and elpy-config no longer opens: it says it cannot find python3. However, python3 is in my path because I can issue it as a command in terminal no problem. For some reason emacs isn't actually capturing my full path. Is this a feature or a bug? I noticed it in many other packages requiring inferior shells as well.
    – xdavidliu
    Commented Mar 14, 2018 at 21:01
  • never mind, I'm on OSX and using gui emacs, and there's a really bad gotcha here that gui emacs (as opposed to terminal emacs) doesn't capture my PATH variable.
    – xdavidliu
    Commented Mar 14, 2018 at 21:18

Set the interpreter variable in your .emacs file:

(setq python-shell-interpreter "python3"
      python-shell-interpreter-args "-i")

Taken from elpy manual

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.