There was a bug (see below) in my elpy/pdb .emacs configuration that showed up when I ran pdb in emacs. I must have missed something in the setup.
Here is the solution:
https://stackoverflow.com/questions/9167614/python-mode-in-emacs-no-such-file-or-directory-pdb
pdb problem
https://github.com/jorgenschaefer/elpy/issues/1001
Elpy really should find the correct python interpreter if it's available inside your virtualenv. The question only is whether M-: (executable-find "python") finds the correct executable, and if not, why not.
M-x elpy-config
http://blog.mijalko.com/2014/02/python-debug-in-virtualenv.html
http://davedash.com/tutorial/pdb-the-python-debugger/
|ImportError: No module named unidecode
Here is the solution:
https://stackoverflow.com/questions/9167614/python-mode-in-emacs-no-such-file-or-directory-pdb
Add this to your .emacs
(defvar virtual_env_dir)
(setq virtual_env_dir (substitute-env-vars "$WORKON_HOME"))
(pyvenv-activate virtual_env_dir)
(setq gud-pdb-command-name "python -m pdb")
(setq gud-pdb-command-name "python -m pdb")
File "process_scraped_records.py", line 1, in
| from datetime import datetime
|ImportError: No module named unidecode
class UrlType(Enum): |Uncaught exception. Entering post mortem debugging
MRP = 1 # multi url record page_type |Running 'cont' or 'step' will restart the program
https://github.com/jorgenschaefer/elpy/issues/1001
Elpy really should find the correct python interpreter if it's available inside your virtualenv. The question only is whether M-: (executable-find "python") finds the correct executable, and if not, why not.
M-x elpy-config
Elpy Configuration
Virtualenv........: kafka (/home/jsmith/python_virtual_env/kafka)
RPC Python........: 2.7.12 (/home/jsmith/python_virtual_env/kafka/bin/python)
Interactive Python: ipython (/home/jsmith/python_virtual_env/kafka/bin/ipython)
Emacs.............: 25.3.2
Elpy..............: 1.17.0
Jedi..............: 0.11.0 (0.11.1 available)
Rope..............: Not found (0.10.7 available)
Importmagic.......: 0.1.7
Autopep8..........: 1.3.3
Yapf..............: 0.20.0
Syntax checker....: flake8 (/home/jsmith/python_virtual_env/kafka/bin/flake8)
There is a newer version of Jedi available.
[run] python -m pip install --upgrade jedi
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] Snippets (YASnippet)
[+]-- [Group] Directory Grep (rgrep)
[+]-- [Group] Search as You Type (ido)
[ ]-- [Group] Django Extension
http://blog.mijalko.com/2014/02/python-debug-in-virtualenv.html
http://davedash.com/tutorial/pdb-the-python-debugger/
No comments:
Post a Comment