jorgenschaefer / elpy

Emacs Python Development Environment
GNU General Public License v3.0
1.9k stars 260 forks source link

error in python-shell-completion-native-disabled-interpreters #1979

Closed fkgruber closed 2 years ago

fkgruber commented 2 years ago

Summary

I was trying to use the recommended configuration to use jupyter and got an error when setting the disabled-interpreter lines

Steps to reproduce

when running:

(add-to-list 'python-shell-completion-native-disabled-interpreters
             "jupyter")

I get:

Debugger entered--Lisp error: (void-variable python-shell-completion-native-disabled-interpreters)
  (member "jupyter" python-shell-completion-native-disabled-interpreters)
  (if (member "jupyter" python-shell-completion-native-disabled-interpreters) python-shell-completion-native-disabled-interpreters (setq python-shell-completion-native-disabled-interpreters (cons "jupyter" python-shell-completion-native-disabled-interpreters)))
  eval((if (member "jupyter" python-shell-completion-native-disabled-interpreters) python-shell-completion-native-disabled-interpreters (setq python-shell-completion-native-disabled-interpreters (cons "jupyter" python-shell-completion-native-disabled-interpreters))) nil)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

My configuration

OS

mac os Monterey 12.2.1

Result of (elpy-config)

Elpy Configuration

Emacs.............: 28.1
Elpy..............: 1.35.0
Virtualenv........: torch (/Users/fred/envs/torch/)
Interactive Python: python ... (/Users/fred/envs/torch/bin/python)
RPC virtualenv....: rpc-venv (/Users/fred/.emacs.d/elpy/rpc-venv)
 Python...........: python 3.9.12 (/Users/fred/.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 (/Users/fred/envs/torch/bin/flake8)

Elpy configuration in my init.el

(use-package elpy
  :ensure t
  :init
  (elpy-enable))

(setq python-shell-interpreter "jupyter"
      python-shell-interpreter-args "console --simple-prompt"
      python-shell-prompt-detect-failure-warning nil)
(add-to-list 'python-shell-completion-native-disabled-interpreters
             "jupyter")
fkgruber commented 2 years ago

same as #1980