emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Fwd: How to use Org with Python as an IDE?
@ 2021-09-04 22:29 edgar
  2021-09-05  1:03 ` edgar
  0 siblings, 1 reply; 5+ messages in thread
From: edgar @ 2021-09-04 22:29 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1168 bytes --]

Is there a current way to have Python (not iPython, Jupyter, Anaconda,  
Conda...) IDE in Emacs?

I sent the forwareded message to the Org (mode) list, because I am  
planning to use Org, but I am in a defeated state, and if I can get  
regular files with autocompletion, navigation and documentation, that  
would be great.

Thanks!

#+begin_src elisp
   (org-version)
#+end_src

#+RESULTS:
: 9.3.7

#+begin_src elisp
   (emacs-version)
#+end_src

#+RESULTS:
: GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27,  
cairo version 1.17.4)
:  of 2021-03-26

| python-jedi         | 0.18.0-2 |
| emacs-ctable        |  0.1.2-3 |
| emacs-deferred      |  0.5.1-2 |
| emacs-epc           |  0.1.1-4 |
| python-epc          |  0.0.5-3 |
| python-black        | 21.7b0-1 |
| python-flake8-black |  0.2.2-1 |




-------------------------------------------------
This free account was provided by VFEmail.net - report spam to abuse@vfemail.net
 
ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  

[-- Attachment #2: Forwarded Message --]
[-- Type: message/rfc822, Size: 18336 bytes --]

From: edgar@openmail.cc
To: emacs-orgmode@gnu.org
Subject: How to use Org with Python as an IDE?
Date: Sat, 04 Sep 2021 04:58:00 +0000
Message-ID: <20210904045800.Horde.q8-nbz1dNR2O47UBMvOa7-A@www.vfemail.net>

Hi!

* Brief

I want to use Emacs to program in Python and combine it with Org. I am  
unable to setup Gtags (my first option), Elpy nor Jedi. I would like  
to stay away from LSP, but I am willing to heed. What you see [[*What  
I have tried][below]] is to show that I really tried.

You should really read this as an Emacs Org file

Why do I write this to the Org community? Because I would like to have  
a solution which works with the best way of organising my life (Org  
and Org Babel). Thanks!

* What I want

I would like to
- be able to have a way to navigate through code similar to  
CEDET/Semantic (some key strokes, and go to the definition of  
something, change into appropriate files, go back, etc.).
- find symbols or tags
- get contextual help about the signature of functions and the like
- have code completion from the current project and system's libraries  
(it would be nice if I can refer to more than one project)

P.S. https://web.libera.chat/ does not let me connect (Tor not accepted?)
P.S.S. StackOverflow's CloudFlare did not let me register

* What I have tried
** Gtags
** Elpy

I think that the creator of Elpy got completely fed up and left the  
project (I could be wrong). The project is now a side-project of  
someone else. It used to work, except for some quirks in Org src  
buffers.

#+begin_src elisp
   ;; https://realpython.com/emacs-the-best-python-editor/
   ;; Install these first: (emacs) epc, deferred, ctable, jedi,
   ;; company, (python) sexpdata, epc, jedi, black
   (use-package elpy
     ;; :ensure elpy
     :defer t ;:defer 1
     :init
     (advice-add 'python-mode :before 'elpy-enable)

     :config
     (setq elpy-rpc-python-command "python3"
           ;; For interactive shell
           python-shell-interpreter "python3"
           ;; Don't use the root of the project, open the shell
           ;; in current directory
           elpy-shell-use-project-root nil)

     (defun custom-python-mode-hook ()
       (setq python-indent-offset 4)
       (setq tab-width 4)
       (setq indent-tabs-mode nil))
     (add-hook 'python-mode-hook 'custom-python-mode-hook)

     (define-key elpy-mode-map (kbd "C-c C-k") 'org-edit-src-abort)
     (define-key elpy-mode-map (kbd "C-c K") 'elpy-shell-kill-all))
#+end_src

I don't know if I am supposed to be running a server ouuside Emacs  
(Jedi?), but I don't get any completion. Didn't even try to get  
documentation on-request. I don't have a virtual environment.

** Jedi alone

I get an error about some =libpython3.7m=

#+begin_src elisp
   (require 'jedi)
   (jedi:install-server)
#+end_src

#+RESULTS:
#+begin_example
#s(deferred (closure ((callback closure ((it . #0) t) (_) (progn  
(set-default 'jedi:server-command (jedi:-env-server-command))))  
(callback closure ((it . #0) t) (_) (progn (set-default  
'jedi:server-command (jedi:-env-server-command)))) (d . #s(deferred  
(closure ((callback . #[128 "\302\300\303\301\x04\"\"\207" [(lambda (msg  
output) (message "%s...Done" msg) (if python-environment--verbose  
(progn (message output)))) ("Running: pip install --upgrade  
~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #8) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #8 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #8) (d . #8) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #8 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #4 nil nil)) cl-struct-deferred-tags t)  
(x) (condition-case nil (progn (deferred:call-lambda callback x))  
(error nil)) x) (closure ((normal closure ((callback . #[128  
"\302\300\303\301\x04\"\"\207" [(lambda (msg output) (message "%s...Done"  
msg) (if python-environment--verbose (progn (message output))))  
("Running: pip install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/")  
apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #10) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #10 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #10) (d . #10) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #10 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #4 nil nil)) cl-struct-deferred-tags t)  
(x) (condition-case nil (progn (deferred:call-lambda callback x))  
(error nil)) x) (callback . #[128 "\302\300\303\301\x04\"\"\207" [(lambda  
(msg output) (message "%s...Done" msg) (if python-environment--verbose  
(progn (message output)))) ("Running: pip install --upgrade  
~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #8) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #8 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #8) (d . #8) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #8 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #4 nil nil)) cl-struct-deferred-tags t)  
(e) (condition-case nil (progn (deferred:call-lambda callback e))  
(error nil)) (deferred:resignal e)) deferred:default-cancel #0 nil  
nil)) cl-struct-deferred-tags t) (x) (condition-case nil (progn  
(deferred:call-lambda callback x)) (error nil)) x) (closure ((normal  
closure ((callback closure ((it . #0) t) (_) (progn (set-default  
'jedi:server-command (jedi:-env-server-command)))) (callback closure  
((it . #0) t) (_) (progn (set-default 'jedi:server-command  
(jedi:-env-server-command)))) (d . #s(deferred (closure ((callback .  
#[128 "\302\300\303\301\x04\"\"\207" [(lambda (msg output) (message  
"%s...Done" msg) (if python-environment--verbose (progn (message  
output)))) ("Running: pip install --upgrade  
~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #10) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #10 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #10) (d . #10) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #10 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #6 nil nil)) cl-struct-deferred-tags t)  
(x) (condition-case nil (progn (deferred:call-lambda callback x))  
(error nil)) x) (closure ((normal closure ((callback . #[128  
"\302\300\303\301\x04\"\"\207" [(lambda (msg output) (message "%s...Done"  
msg) (if python-environment--verbose (progn (message output))))  
("Running: pip install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/")  
apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #12) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #12 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #12) (d . #12) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #12 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #6 nil nil)) cl-struct-deferred-tags t)  
(x) (condition-case nil (progn (deferred:call-lambda callback x))  
(error nil)) x) (callback . #[128 "\302\300\303\301\x04\"\"\207" [(lambda  
(msg output) (message "%s...Done" msg) (if python-environment--verbose  
(progn (message output)))) ("Running: pip install --upgrade  
~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #10) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #10 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #10) (d . #10) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #10 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #6 nil nil)) cl-struct-deferred-tags t)  
(e) (condition-case nil (progn (deferred:call-lambda callback e))  
(error nil)) (deferred:resignal e)) deferred:default-cancel #0 nil  
nil)) cl-struct-deferred-tags t) (x) (condition-case nil (progn  
(deferred:call-lambda callback x)) (error nil)) x) (callback closure  
((it . #0) t) (_) (progn (set-default 'jedi:server-command  
(jedi:-env-server-command)))) (callback closure ((it . #0) t) (_)  
(progn (set-default 'jedi:server-command (jedi:-env-server-command))))  
(d . #s(deferred (closure ((callback . #[128  
"\302\300\303\301\x04\"\"\207" [(lambda (msg output) (message "%s...Done"  
msg) (if python-environment--verbose (progn (message output))))  
("Running: pip install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/")  
apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #8) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #8 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #8) (d . #8) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #8 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #4 nil nil)) cl-struct-deferred-tags t)  
(x) (condition-case nil (progn (deferred:call-lambda callback x))  
(error nil)) x) (closure ((normal closure ((callback . #[128  
"\302\300\303\301\x04\"\"\207" [(lambda (msg output) (message "%s...Done"  
msg) (if python-environment--verbose (progn (message output))))  
("Running: pip install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/")  
apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #10) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #10 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #10) (d . #10) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #10 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #4 nil nil)) cl-struct-deferred-tags t)  
(x) (condition-case nil (progn (deferred:call-lambda callback x))  
(error nil)) x) (callback . #[128 "\302\300\303\301\x04\"\"\207" [(lambda  
(msg output) (message "%s...Done" msg) (if python-environment--verbose  
(progn (message output)))) ("Running: pip install --upgrade  
~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #8) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #8 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #8) (d . #8) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #8 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #4 nil nil)) cl-struct-deferred-tags t)  
(e) (condition-case nil (progn (deferred:call-lambda callback e))  
(error nil)) (deferred:resignal e)) deferred:default-cancel #0 nil  
nil)) cl-struct-deferred-tags t) (e) (condition-case nil (progn  
(deferred:call-lambda callback e)) (error nil)) (deferred:resignal e))  
deferred:default-cancel nil nil nil)
#+end_example

Plus this:
#+begin_example
   deferred error : (error "Deferred process exited abnormally:
     command: /home/edgar/.emacs.d/.python-environments/default/bin/pip
     exit status: exit 127
     event: exited abnormally with code 127
     buffer contents:  
\"~/.emacs.d/.python-environments/default/bin/python: error while  
loading shared libraries: libpython3.7m.so.1.0: cannot open shared  
object file: No such file or directory
#+end_example


^ permalink raw reply	[flat|nested] 5+ messages in thread
* How to use Org with Python as an IDE?
@ 2021-09-04  4:58 edgar
  0 siblings, 0 replies; 5+ messages in thread
From: edgar @ 2021-09-04  4:58 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

* Brief

I want to use Emacs to program in Python and combine it with Org. I am  
unable to setup Gtags (my first option), Elpy nor Jedi. I would like  
to stay away from LSP, but I am willing to heed. What you see [[*What  
I have tried][below]] is to show that I really tried.

You should really read this as an Emacs Org file

Why do I write this to the Org community? Because I would like to have  
a solution which works with the best way of organising my life (Org  
and Org Babel). Thanks!

* What I want

I would like to
- be able to have a way to navigate through code similar to  
CEDET/Semantic (some key strokes, and go to the definition of  
something, change into appropriate files, go back, etc.).
- find symbols or tags
- get contextual help about the signature of functions and the like
- have code completion from the current project and system's libraries  
(it would be nice if I can refer to more than one project)

P.S. https://web.libera.chat/ does not let me connect (Tor not accepted?)
P.S.S. StackOverflow's CloudFlare did not let me register

* What I have tried
** Gtags
** Elpy

I think that the creator of Elpy got completely fed up and left the  
project (I could be wrong). The project is now a side-project of  
someone else. It used to work, except for some quirks in Org src  
buffers.

#+begin_src elisp
   ;; https://realpython.com/emacs-the-best-python-editor/
   ;; Install these first: (emacs) epc, deferred, ctable, jedi,
   ;; company, (python) sexpdata, epc, jedi, black
   (use-package elpy
     ;; :ensure elpy
     :defer t ;:defer 1
     :init
     (advice-add 'python-mode :before 'elpy-enable)

     :config
     (setq elpy-rpc-python-command "python3"
           ;; For interactive shell
           python-shell-interpreter "python3"
           ;; Don't use the root of the project, open the shell
           ;; in current directory
           elpy-shell-use-project-root nil)

     (defun custom-python-mode-hook ()
       (setq python-indent-offset 4)
       (setq tab-width 4)
       (setq indent-tabs-mode nil))
     (add-hook 'python-mode-hook 'custom-python-mode-hook)

     (define-key elpy-mode-map (kbd "C-c C-k") 'org-edit-src-abort)
     (define-key elpy-mode-map (kbd "C-c K") 'elpy-shell-kill-all))
#+end_src

I don't know if I am supposed to be running a server ouuside Emacs  
(Jedi?), but I don't get any completion. Didn't even try to get  
documentation on-request. I don't have a virtual environment.

** Jedi alone

I get an error about some =libpython3.7m=

#+begin_src elisp
   (require 'jedi)
   (jedi:install-server)
#+end_src

#+RESULTS:
#+begin_example
#s(deferred (closure ((callback closure ((it . #0) t) (_) (progn  
(set-default 'jedi:server-command (jedi:-env-server-command))))  
(callback closure ((it . #0) t) (_) (progn (set-default  
'jedi:server-command (jedi:-env-server-command)))) (d . #s(deferred  
(closure ((callback . #[128 "\302\300\303\301\x04\"\"\207" [(lambda (msg  
output) (message "%s...Done" msg) (if python-environment--verbose  
(progn (message output)))) ("Running: pip install --upgrade  
~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #8) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #8 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #8) (d . #8) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #8 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #4 nil nil)) cl-struct-deferred-tags t)  
(x) (condition-case nil (progn (deferred:call-lambda callback x))  
(error nil)) x) (closure ((normal closure ((callback . #[128  
"\302\300\303\301\x04\"\"\207" [(lambda (msg output) (message "%s...Done"  
msg) (if python-environment--verbose (progn (message output))))  
("Running: pip install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/")  
apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #10) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #10 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #10) (d . #10) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #10 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #4 nil nil)) cl-struct-deferred-tags t)  
(x) (condition-case nil (progn (deferred:call-lambda callback x))  
(error nil)) x) (callback . #[128 "\302\300\303\301\x04\"\"\207" [(lambda  
(msg output) (message "%s...Done" msg) (if python-environment--verbose  
(progn (message output)))) ("Running: pip install --upgrade  
~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #8) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #8 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #8) (d . #8) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #8 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #4 nil nil)) cl-struct-deferred-tags t)  
(e) (condition-case nil (progn (deferred:call-lambda callback e))  
(error nil)) (deferred:resignal e)) deferred:default-cancel #0 nil  
nil)) cl-struct-deferred-tags t) (x) (condition-case nil (progn  
(deferred:call-lambda callback x)) (error nil)) x) (closure ((normal  
closure ((callback closure ((it . #0) t) (_) (progn (set-default  
'jedi:server-command (jedi:-env-server-command)))) (callback closure  
((it . #0) t) (_) (progn (set-default 'jedi:server-command  
(jedi:-env-server-command)))) (d . #s(deferred (closure ((callback .  
#[128 "\302\300\303\301\x04\"\"\207" [(lambda (msg output) (message  
"%s...Done" msg) (if python-environment--verbose (progn (message  
output)))) ("Running: pip install --upgrade  
~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #10) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #10 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #10) (d . #10) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #10 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #6 nil nil)) cl-struct-deferred-tags t)  
(x) (condition-case nil (progn (deferred:call-lambda callback x))  
(error nil)) x) (closure ((normal closure ((callback . #[128  
"\302\300\303\301\x04\"\"\207" [(lambda (msg output) (message "%s...Done"  
msg) (if python-environment--verbose (progn (message output))))  
("Running: pip install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/")  
apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #12) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #12 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #12) (d . #12) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #12 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #6 nil nil)) cl-struct-deferred-tags t)  
(x) (condition-case nil (progn (deferred:call-lambda callback x))  
(error nil)) x) (callback . #[128 "\302\300\303\301\x04\"\"\207" [(lambda  
(msg output) (message "%s...Done" msg) (if python-environment--verbose  
(progn (message output)))) ("Running: pip install --upgrade  
~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #10) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #10 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #10) (d . #10) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #10 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #6 nil nil)) cl-struct-deferred-tags t)  
(e) (condition-case nil (progn (deferred:call-lambda callback e))  
(error nil)) (deferred:resignal e)) deferred:default-cancel #0 nil  
nil)) cl-struct-deferred-tags t) (x) (condition-case nil (progn  
(deferred:call-lambda callback x)) (error nil)) x) (callback closure  
((it . #0) t) (_) (progn (set-default 'jedi:server-command  
(jedi:-env-server-command)))) (callback closure ((it . #0) t) (_)  
(progn (set-default 'jedi:server-command (jedi:-env-server-command))))  
(d . #s(deferred (closure ((callback . #[128  
"\302\300\303\301\x04\"\"\207" [(lambda (msg output) (message "%s...Done"  
msg) (if python-environment--verbose (progn (message output))))  
("Running: pip install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/")  
apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #8) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #8 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #8) (d . #8) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #8 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #4 nil nil)) cl-struct-deferred-tags t)  
(x) (condition-case nil (progn (deferred:call-lambda callback x))  
(error nil)) x) (closure ((normal closure ((callback . #[128  
"\302\300\303\301\x04\"\"\207" [(lambda (msg output) (message "%s...Done"  
msg) (if python-environment--verbose (progn (message output))))  
("Running: pip install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/")  
apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #10) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #10 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #10) (d . #10) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #10 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #4 nil nil)) cl-struct-deferred-tags t)  
(x) (condition-case nil (progn (deferred:call-lambda callback x))  
(error nil)) x) (callback . #[128 "\302\300\303\301\x04\"\"\207" [(lambda  
(msg output) (message "%s...Done" msg) (if python-environment--verbose  
(progn (message output)))) ("Running: pip install --upgrade  
~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (callback . #[128 "\302\300\303\301\x04\"\"\207"  
[(lambda (msg output) (message "%s...Done" msg) (if  
python-environment--verbose (progn (message output)))) ("Running: pip  
install --upgrade ~/.emacs.d/elpa/jedi-core-0.2.8/") apply append] 6 "

(fn &rest ARGS2)"]) (d . #s(deferred (closure ((d . #8) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #8 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (buf) (prog1 (save-current-buffer  
(set-buffer buf) (buffer-string)) (kill-buffer buf)))  
deferred:default-errorback (closure ((v . #8) (d . #8) (pd .  
#s(deferred deferred:default-callback deferred:default-errorback  
deferred:default-cancel #8 nil nil)) (args "install" "--upgrade"  
"~/.emacs.d/elpa/jedi-core-0.2.8/") (command .  
"~/.emacs.d/.python-environments/default/bin/pip") (f . start-process)  
cl-struct-deferred-tags t) (_x) (deferred:default-cancel d)  
(deferred:default-cancel pd)) #4 nil nil)) cl-struct-deferred-tags t)  
(e) (condition-case nil (progn (deferred:call-lambda callback e))  
(error nil)) (deferred:resignal e)) deferred:default-cancel #0 nil  
nil)) cl-struct-deferred-tags t) (e) (condition-case nil (progn  
(deferred:call-lambda callback e)) (error nil)) (deferred:resignal e))  
deferred:default-cancel nil nil nil)
#+end_example

Plus this:
#+begin_example
   deferred error : (error "Deferred process exited abnormally:
     command: /home/edgar/.emacs.d/.python-environments/default/bin/pip
     exit status: exit 127
     event: exited abnormally with code 127
     buffer contents:  
\"~/.emacs.d/.python-environments/default/bin/python: error while  
loading shared libraries: libpython3.7m.so.1.0: cannot open shared  
object file: No such file or directory
#+end_example



-------------------------------------------------
This free account was provided by VFEmail.net - report spam to abuse@vfemail.net
 
ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-07  3:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-04 22:29 Fwd: How to use Org with Python as an IDE? edgar
2021-09-05  1:03 ` edgar
2021-09-06 22:20   ` Dr. Arne Babenhauserheide
2021-09-07  3:37     ` edgar
  -- strict thread matches above, loose matches on Subject: below --
2021-09-04  4:58 edgar

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).