The Python interpreter could not find the elpy module.
Summary
When starting elpy with a Python 3.10 interpreter prevents starting the rpc process.
Steps to reproduce
- Remove ~/.emacs.d/elpy/rpc-env
- Install latest elpy from melpa
- Let elpy reinstall the RPC env
My configuration
OS
Linex, Fedora 35
Result of (elpy-config)
Elpy Configuration
Emacs.............: 27.2 Elpy..............: Not found (Python), 1.35.0 (Emacs Lisp) Virtualenv........: None Interactive Python: python 3.10.1 (/usr/bin/python) RPC virtualenv....: rpc-venv (/home/wegge/.emacs.d/elpy/rpc-venv) Python...........: python nil (/home/wegge/.emacs.d/elpy/rpc-venv/bin/python) Jedi.............: Not found Rope.............: Not found Autopep8.........: Not found Yapf.............: Not found Black............: Not found Syntax checker....: Not found (flake8)
Warnings
You have not activated a virtual env. It is not mandatory but often a
good idea to work inside a virtual env. You can use M-x pyvenv-activate or M-x pyvenv-workon to activate one.
The Python interpreter could not find the elpy module. Please report to: https://github.com/jorgenschaefer/elpy/issues/new.
There was an unexpected problem starting the RPC process. Please check the following output to see if this makes sense to you. To me, it doesn't.
Elpy could not connect to Pypi (or at least not quickly enough) and check if the python packages were up-to-date. You can still try to update all of them:
[Update python packages]
The Jedi package is not currently installed. This package is needed for code completion, code navigation and access to documentation.
[Install jedi]
No autoformatting package is currently installed. At least one is
needed (Autopep8, Yapf or Black) to perform autoformatting (C-c C-r f in a python buffer).
[Install autopep8] [Install yapf] [Install black]
The configured syntax checker (flake8) could not be found. Elpy uses
this program to provide syntax checks of your code. You can either
install it, or select another one using elpy-syntax-check-command.
[Install flake8]
Options
`Raised' text indicates buttons; type RET or click mouse-1 on a button to invoke its action. Invoke [+] to expand a group, and [-] to collapse an expanded group. Invoke the [Group], [Face], and [Option] buttons below to edit that item in another window.
[+]-- Group Elpy [+]-- Group Python [+]-- Group Virtual Environments (Pyvenv) [+]-- Group Completion (Company) [+]-- Group Call Signatures (ElDoc) [+]-- Group Inline Errors (Flymake) [+]-- Group Code folding (hideshow) [+]-- Group Snippets (YASnippet) [+]-- Group Directory Grep (rgrep) [+]-- Group Search as You Type (ido) [+]-- Group Django extension [+]-- Group Autodoc extension
Elpy configuration in my init.el
(elpy-enable)
Same here on a Windows machine.
Same for me on Ubuntu 22.04 and Emacs 28 except that it finds the virtual env.
Edit Using straight instead of melpa just solved the issue `Elpy Configuration
Emacs.............: 28.1 Elpy..............: 1.35.0 Virtualenv........: base-emacs (/home/ad9438/pyvenvs/base-emacs/) Interactive Python: python3 3.10.4 (/home/ad9438/pyvenvs/base-emacs/bin/python3) RPC virtualenv....: rpc-venv (/home/ad9438/.emacs.d/elpy/rpc-venv) Python...........: python 3.10.4 (/home/ad9438/.emacs.d/elpy/rpc-venv/bin/python) Jedi.............: 0.18.1 Autopep8.........: 1.6.0 Yapf.............: 0.32.0 Black............: 22.3.0 Syntax checker....: flake8 (/home/ad9438/pyvenvs/base-emacs/bin/flake8)
Warnings
Options
Square brackets indicate buttons; type RET or click mouse-1 on a button to invoke its action. Invoke [+] to expand a group, and [-] to collapse an expanded group. Invoke the [Group], [Face], and [Option] buttons below to edit that item in another window.
[+]-- [Group] Elpy [+]-- [Group] Python [+]-- [Group] Virtual Environments (Pyvenv) [+]-- [Group] Completion (Company) [+]-- [Group] Call Signatures (ElDoc) [+]-- [Group] Inline Errors (Flymake) [+]-- [Group] Code folding (hideshow) [+]-- [Group] Snippets (YASnippet) [+]-- [Group] Directory Grep (rgrep) [+]-- [Group] Search as You Type (ido) [+]-- [Group] Django extension [+]-- [Group] Autodoc extension `
Getting this error as well on Arch Linux
Elpy Configuration
Emacs.............: 27.2
Elpy..............: Not found (Python), 1.35.0 (Emacs Lisp)
Virtualenv........: None
Interactive Python: python 3.10.1 (/usr/bin/python)
RPC virtualenv....: rpc-venv (/home/michael/.emacs.d/elpy/rpc-venv)
Python...........: python nil (/home/michael/.emacs.d/elpy/rpc-venv/bin/python)
Jedi.............: Not found
Autopep8.........: Not found
Yapf.............: Not found
Black............: Not found
Syntax checker....: Not found (flake8)
Warnings
You have not activated a virtual env. It is not mandatory but often a
good idea to work inside a virtual env. You can use `M-x
pyvenv-activate` or `M-x pyvenv-workon` to activate one.
The Python interpreter could not find the elpy module. Please report to:
https://github.com/jorgenschaefer/elpy/issues/new.
There was an unexpected problem starting the RPC process. Please check
the following output to see if this makes sense to you. To me, it
doesn't.
<string>:3: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
{"can_connect_to_pypi": true, "rpc_python_version": "3.10.1", "elpy_version": null, "jedi_version": "0.18.1", "jedi_latest": null, "rope_version": null, "rope_latest": "1.3.0", "autopep8_version": "1.7.0", "autopep8_latest": null, "yapf_version": "0.32.0", "yapf_latest": null, "black_version": "22.6.0", "black_latest": null}
Elpy could not connect to Pypi (or at least not quickly enough) and
check if the python packages were up-to-date. You can still try to
update all of them:
[Update python packages]
The Jedi package is not currently installed. This package is needed for
code completion, code navigation and access to documentation.
[Install jedi]
No autoformatting package is currently installed. At least one is needed
(Autopep8, Yapf or Black) to perform autoformatting (`C-c C-r f` in a
python buffer).
[Install autopep8]
[Install yapf]
[Install black]
The configured syntax checker (flake8) could not be found. Elpy uses
this program to provide syntax checks of your code. You can either
install it, or select another one using `elpy-syntax-check-command`.
[Install flake8]
Options
`Raised' text indicates buttons; type RET or click mouse-1 on a button
to invoke its action. Invoke [+] to expand a group, and [-] to collapse
an expanded group. Invoke the [Group], [Face], and [Option] buttons
below to edit that item in another window.
[+]-- Group Elpy
[+]-- Group Python
[+]-- Group Virtual Environments (Pyvenv)
[+]-- Group Completion (Company)
[+]-- Group Call Signatures (ElDoc)
[+]-- Group Inline Errors (Flymake)
[+]-- Group Code folding (hideshow)
[+]-- Group Snippets (YASnippet)
[+]-- Group Directory Grep (rgrep)
[+]-- Group Search as You Type (ido)
[+]-- Group Django extension
[+]-- Group Autodoc extension
Same Problem on ubuntu 22.04. Any solutions?
Elpy Configuration
Emacs.............: 27.1
Elpy..............: Not found (Python), 1.35.0 (Emacs Lisp)
Virtualenv........: None
Interactive Python: ipython 8.4.0 (/usr/local/bin/ipython)
RPC virtualenv....: rpc-venv (/home/m/.emacs.d/elpy/rpc-venv)
Python...........: python nil (/home/m/.emacs.d/elpy/rpc-venv/bin/python)
Jedi.............: Not found
Rope.............: Not found
Autopep8.........: Not found
Yapf.............: Not found
Black............: Not found
Syntax checker....: flake8 (/home/m/.local/bin/flake8)
Warnings
You have not activated a virtual env. It is not mandatory but often a
good idea to work inside a virtual env. You can use `M-x
pyvenv-activate` or `M-x pyvenv-workon` to activate one.
The Python interpreter could not find the elpy module. Please report
to: https://github.com/jorgenschaefer/elpy/issues/new.
There was an unexpected problem starting the RPC process. Please check
the following output to see if this makes sense to you. To me, it
doesn't.
<string>:28: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
{"can_connect_to_pypi": true, "rpc_python_version": "3.10.6", "elpy_version": "1.35.0", "jedi_version": "0.18.2", "jedi_latest": null, "rope_version": "1.7.0", "rope_latest": null, "autopep8_version": "2.0.2", "autopep8_latest": null, "yapf_version": "0.32.0", "yapf_latest": null, "black_version": "23.1.0", "black_latest": null}
Elpy could not connect to Pypi (or at least not quickly enough) and
check if the python packages were up-to-date. You can still try to
update all of them:
[Update python packages]
The Jedi package is not currently installed. This package is needed
for code completion, code navigation and access to documentation.
[Install jedi]
No autoformatting package is currently installed. At least one is
needed (Autopep8, Yapf or Black) to perform autoformatting (`C-c C-r
f` in a python buffer).
[Install autopep8]
[Install yapf]
[Install black]
Options
`Raised' text indicates buttons; type RET or click mouse-1 on a button
to invoke its action. Invoke [+] to expand a group, and [-] to
collapse an expanded group. Invoke the [Group], [Face], and [Option]
buttons below to edit that item in another window.
[+]-- Group Elpy
[+]-- Group Python
[+]-- Group Virtual Environments (Pyvenv)
[+]-- Group Completion (Company)
[+]-- Group Call Signatures (ElDoc)
[+]-- Group Inline Errors (Flymake)
[+]-- Group Code folding (hideshow)
[+]-- Group Snippets (YASnippet)
[+]-- Group Directory Grep (rgrep)
[+]-- Group Search as You Type (ido)
[+]-- Group Django extension
[+]-- Group Autodoc extension