0

I'm running python 3.12 at work on windows using emacs as IDE. At home I'm running linux where my setup works without any issue. However, at work with windows I struggle to get it properly run.

I have created I virtualenv and looking at the output of my elpy config everything seems fine:

Elpy Configuration Emacs.............: 29.1 Elpy..............: 1.35.0 Virtualenv........: srv_sys (c:/Users/ca/srv_sys/) Interactive Python: ipython . (c:/Users/ca/srv_sys/Scripts/ipython.exe) RPC virtualenv....: rpc-venv (c:/Users/ca/AppData/Roaming/.emacs.d/elpy/rpc-venv) Python...........: c:/WINDOWS/py.exe 3.12.4 (c:/WINDOWS/py.exe) Jedi.............: 0.19.2 Autopep8.........: 2.3.2 Yapf.............: 0.43.0 Black............: 25.1.0 Syntax checker....: flake8.exe (c:/Users/ca/srv_sys/Scripts/flake8.exe) Warnings 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 

As soon as I want to run a code snippet or launch python via M-x run-phython I get the following error message:

start-process: Spawning child process: Exec format error

*Messages* say not much more and I'm a bit lost how to proceed from here? Does anyone know how to fix this?

What makes this even stranger is, that for another virtualenv, I'm able to run python. This is elpy-config from the virtualenv that works

Elpy Configuration Emacs.............: 29.1 Elpy..............: 1.35.0 Virtualenv........: srv_re (c:/Users/ca/srv_re/) Interactive Python: ipython 8.26.0 (c:/Users/ca/srv_re/Scripts/ipython.exe) RPC virtualenv....: rpc-venv (c:/Users/ca/AppData/Roaming/.emacs.d/elpy/rpc-venv) Python...........: c:/WINDOWS/py.exe 3.12.4 (c:/WINDOWS/py.exe) Jedi.............: 0.19.2 Autopep8.........: 2.3.2 Yapf.............: 0.43.0 Black............: 25.1.0 Syntax checker....: flake8.exe (c:/Users/ca/srv_re/Scripts/flake8.exe) Warnings 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 

The only difference I see lies in ipython. The virtualenv sys uses 9.0.2 while the wokring one re 8.26.0. However, I've even tried to install 8.26.0 in the virtualenv sys, too. It still shows up as . in elpy-config.

3
  • In Emacs 29.1 try to use the built-in package eglot - on some systems works simply M-x eglot . Has same feature as elpy. Commented Mar 26 at 13:55
  • @Ian thanks for your comment. before switching to a complete new setup that I have no experience (nor estimate of how much it takes) i would like to figure out what is causing the issue. Apparently it does work, like for the venv re Commented Mar 27 at 7:37
  • It is not clear to me if you use the same python script in both venvs, or not, to compare the described behavior. One source could be ipython, other the scripts, depending what functions/modules are used; IIRC a couple of years ago someone (on SE) had a similar problem on Windows and make some adjustments of elpy's rpc file, search for it if you need elpy. Take into account elpy is ten years old and the maintainer has problems with that; a lot of changes in Python were done, and some other modules were modified to comply with vscode. So the suggestion to move to eglot. Commented Mar 27 at 12:39

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.