emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to use Org with Python as an IDE?
@ 2021-09-04  4:58 edgar
  0 siblings, 0 replies; 4+ 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] 4+ messages in thread

* Re: How to use Org with Python as an IDE?
  2021-09-06 22:20   ` Dr. Arne Babenhauserheide
@ 2021-09-07  3:37     ` edgar
  0 siblings, 0 replies; 4+ messages in thread
From: edgar @ 2021-09-07  3:37 UTC (permalink / raw)
  To: Dr. Arne Babenhauserheide; +Cc: help-gnu-emacs, emacs-orgmode

On 2021-09-06 22:20, Dr. Arne Babenhauserheide wrote:
> It’s the finding that’s hard, not the setup.

Very kind of you.
Sehr net von dir.

> You may also want to use flake8. That helps keep your code pythonic. I
> don’t know how much of that is in pylint.

Actually, it's running on my computer. I may have to configure it. Thank 
you for the heads-up.
Wirklich ist es in meinen Computer. Vielleicht, muss ich es gestalten. 
Danke für die Beratung.

> What you may want to add is tangling and *detangling* of
> Python-codeblocks in org-mode so you can get a full Python-IDE

Yes, that is a good advice. I really want to keep my code organised.
Ja, das ist wirklich einen gutte Beratung. Ich wil meinen Code gut 
organisieren.

> Best wishes,
> Arne

You too :)
Dir auch ! (I tried ;P )

-------------------------------------------------
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] 4+ messages in thread

* Re: How to use Org with Python as an IDE?
  2021-09-05  1:03 ` edgar
@ 2021-09-06 22:20   ` Dr. Arne Babenhauserheide
  2021-09-07  3:37     ` edgar
  0 siblings, 1 reply; 4+ messages in thread
From: Dr. Arne Babenhauserheide @ 2021-09-06 22:20 UTC (permalink / raw)
  To: edgar; +Cc: help-gnu-emacs, emacs-orgmode

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


edgar@openmail.cc writes:

> I am very sorry for wasting your precious time. This was very simple

It’s the finding that’s hard, not the setup.

> 1. Install (some are optional) python-language-server  
> jedi-language-server bash-language-server python-pylint  
> python-pydocstyle ccls python-pyls-black

You may also want to use flake8. That helps keep your code pythonic. I
don’t know how much of that is in pylint.

What you may want to add is tangling and *detangling* of
Python-codeblocks in org-mode so you can get a full Python-IDE with
actually working files that you can merge back into org for
documentation. As an example:

https://hg.sr.ht/~arnebab/draketo/browse/anderes/mathe-ass.org?rev=432c5954109b#L346

#+begin_src javascript :tangle "mathe-ass.js" :exports none :comments link
…
#+end_src

Mind the :comments link. That allows getting changed code back into org
by running org-babel-detangle.

- org-babel-tangle creates your working codefile.
- hack in the codefile with full IDE support.
- org-babel-detangle gets your code back into org for better documentation.

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

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

* Re: How to use Org with Python as an IDE?
  2021-09-04 22:29 Fwd: " edgar
@ 2021-09-05  1:03 ` edgar
  2021-09-06 22:20   ` Dr. Arne Babenhauserheide
  0 siblings, 1 reply; 4+ messages in thread
From: edgar @ 2021-09-05  1:03 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: emacs-orgmode

I am very sorry for wasting your precious time. This was very simple

1. Install (some are optional) python-language-server  
jedi-language-server bash-language-server python-pylint  
python-pydocstyle ccls python-pyls-black
2. Clone https://github.com/joaotavora/eglot
3. Add this to your .init.el or .emacs

(require 'package)
(package-initialize)

(defun load-eglot-company ()
   "Loads `eglot' and `company'"
   (eglot-ensure)
   (company-mode))
(add-hook 'python-mode-hook 'load-eglot-company)

(use-package eglot
   :after prog-mode
   :load-path "~/.emacs.d/plugins/eglot"
   :config
   (add-hook 'c-mode-hook 'load-eglot-company)
   (add-hook 'c++-mode-hook 'load-eglot-company)
   (add-hook 'c-mode-common-hook 'load-eglot-company))


I can't believe that I can now be in the 21st century. Thanks to all  
the developers and the free software community!
<p>Quoting <a  
href="mailto:edgar@openmail.cc">edgar@openmail.cc</a>:</p><blockquote  
type="cite" style="border-left:2px solid  
blue;margin-left:2px;padding-left:12px;">Is there a current way to  
have Python (not iPython, Jupyter, Anaconda, Conda...) IDE in  
Emacs?<br />
<br />
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.<br />
<br />
Thanks!<br />
<br />
#+begin_src elisp<br />
  (org-version)<br />
#+end_src<br />
<br />
#+RESULTS:<br />
: 9.3.7<br />
<br />
#+begin_src elisp<br />
  (emacs-version)<br />
#+end_src<br />
<br />
#+RESULTS:<br />
: GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27,  
cairo version 1.17.4)<br />
:&nbsp; of 2021-03-26<br />
<br />
| python-jedi&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| 0.18.0-2 |<br />
| emacs-ctable&nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; 0.1.2-3 |<br />
| emacs-deferred&nbsp; &nbsp; &nbsp; |&nbsp; 0.5.1-2 |<br />
| emacs-epc&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; 0.1.1-4 |<br />
| python-epc&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; 0.0.5-3 |<br />
| python-black&nbsp; &nbsp; &nbsp; &nbsp; | 21.7b0-1 ||  
python-flake8-black |&nbsp; 0.2.2-1 |</blockquote><br /><br />



-------------------------------------------------
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] 4+ messages in thread

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-04  4:58 How to use Org with Python as an IDE? edgar
2021-09-04 22:29 Fwd: " edgar
2021-09-05  1:03 ` edgar
2021-09-06 22:20   ` Dr. Arne Babenhauserheide
2021-09-07  3:37     ` 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 NNTP newsgroup(s).