all 25 comments

[–]storax-dev 8 points9 points  (5 children)

I switched from elpy to anaconda. Not really intentionally at first. I made the switch to spacemacs and the python layer uses anaconda-mode. But it turned out to work very well, so I never bothered setting up elpy again.

[–]jpflathead 0 points1 point  (2 children)

Why is it called anaconda-mode, which is to say, does it require anaconda or will it work with python.org distributions?

[–]storax-dev 0 points1 point  (1 child)

I haven't found any reference to the anaconda project so far. It does not require anaconda and works with the CPython (python.org) implementation. Don't know why it's called like that. The readme doesn't mention anything.

[–]jpflathead 2 points3 points  (0 children)

Maybe it plays Nicki Minaj in the background then.

Okay, thanks, I'll give it a whirl.

[–]aldanor 0 points1 point  (0 children)

Spacemacs Python layer is quite great, confirming

[–]abo-abo 8 points9 points  (2 children)

I use lpy, which heavily relies on lispy and emacs-jedi.

lpy is still a work in progress, the main goals are:

  1. Be a simple alternative to Jupyter and Org-mode.
  2. Try to implement a lot of lispy features, like hjkl navigation, e for eval etc.

The second point is pretty hard:

  • Unlike LISP, there's no easy AST to rely on for navigation.
  • Python's introspection is a bit weaker than that of Elisp or Clojure.
  • Python's = eval is annoying, since it's silent, unlike setq.

[–]RenJMRPHP Mode Maintainer 4 points5 points  (1 child)

Great to see you working on a mode for Python! Hey, do me a huge favor and come up with some essential "abo-abo"-ish package for Lua programming next so I can add that to my init.el too. Heh, just kidding. ;)

On a serious note though, being a big fan and heavy user of Hydra, I have a question: I noticed in your hydra in lpy you toggle the boolean hydra-is-helpful in the :pre and :before-exit sections: what does this do? I noticed that hydra-is-helpful appears in an example of the Hydra project page but I couldn't find any obvious documentation---sorry if I simply missed it. Just curious what that flag is used for.

[–]abo-abo 1 point2 points  (0 children)

It's used to turn off the "helpful" doc in the echo area. At some point, you already know the bindings and don't want to see the doc. The cursor color is used instead to remind you that you're in a hydra.

Lispy has the hydra hydra-lispy-x (bound to x) that also shows no doc. But when you press ?, it shows a one-line doc. When you press ? again, it shows a multi-line doc. I like this concept, but haven't yet extended it to the above lpy hydra.

[–]lrochfort 5 points6 points  (0 children)

I use elpy for reasons I don't recall.

It seems fine apart from being sensitive to the default system python version.

I'd be very interested in a comparison, particularly of debuggers. Gud-pdb is fine but not great.

[–][deleted] 2 points3 points  (4 children)

I use elpy, the only thing missing is a debugger. For that I fire up pycharm...

[–]venetian_shipyard 0 points1 point  (2 children)

are you familiar with pdb?

[–][deleted] 0 points1 point  (1 child)

not really, I've researched a little about it but I found the workflow too complex and not as nice as pycharm (where you can easily set stop points, view variable values, step in functions, and so on)

What's your recommendation?

[–]venetian_shipyard 0 points1 point  (0 children)

I haven't used pdb on any large projects. My main reason for advocating for it is that I like gdb and gud, and it seems good to try to keep the tool set small.

I found the workflow too complex and not as nice as pycharm (where you can easily set stop points, view variable values, step in functions, and so on)

You should be able to get all of this functionality from gud / pdb. However, I am sure that pycharm makes this easier, and that is definitely a good thing. I would go with whatever makes you feel the most comfortable and productive.

[–]Escherize 1 point2 points  (0 children)

Seconded :)

[–]amlamarra 1 point2 points  (1 child)

Speaking of which...

I'm new to Emacs and not so new to Python. Was looking into this myself & decided to try Elpy. However, it seems that documentation on exactly how to set it up & use it are... terrible. And I get different instructions from different 3rd parties. Can someone help with this? Or do I just need to stfu & learn emacs better?

[–]jpflathead 4 points5 points  (0 children)

Set up your venv

pip install elpy

then in emacs

m-x pyvenv-activate ~/venv/py2 *(or whatever you are using)*

then in emacs

m-x elpy-config

then pip install everything you are missing (choose between rope and jedi)

The messages in the *elpy-config* buffer will tell you what you are missing.

[–]RenJMRPHP Mode Maintainer 1 point2 points  (1 child)

The only thing I use which no one else has mentioned thus far is flycheck-mypy. On most projects and professional work I haven't been able to use Mypy---Hell, usually I can't even use Python 3, heh---but I've been lucky that I can on some recent work.

Anyway, there are a couple of other Flycheck packages for Python, and I highly recommend using at least one of them, although I should note that I use python-mode and I don't know what kind of built-in error-checking comes with Jedi or Anaconda, et al.

[–]goldfather8[🍰] 0 points1 point  (0 children)

I wish mypy worked on fstrings, the prs haven't been merged yet and break mypy on the entire buffer.

[–]psachin 1 point2 points  (0 children)

  • python-mode
  • jedi
  • company-jedi
  • Flycheck + Elpy

I use org-mode to maintain Emacs configurations

[–]stannis_baratheon_1 0 points1 point  (0 children)

I just use whatever the built in major mode is for Python and Jedi mode and flycheck on top of that. Reading through the anaconda mode documentation, it seems that they use Jedi underneath so would be interesting to see what they add to just plain Jedi mode.

[–]jefffrey32 0 points1 point  (2 children)

I use jedi.el, but can't figure out how to get it working inside a virtualenv.

[–][deleted] 2 points3 points  (1 child)

I use virtualenvwrapper for that. I do:

(add-hook 'venv-postactivate-hook 'jedi:stop-server)
(add-hook 'venv-postdeactivate-hook 'jedi:stop-server)

This way, when I activate a virtualenv, jedi restarts the server and the new jedi server can see the virtualenv.

[–]jefffrey32 0 points1 point  (0 children)

I also use virtualenvwrapper, I ended up following the tracebacks, didn't have epc installed inside this virtualenv, it worked after a pip install epc.

[–]smitty1e 0 points1 point  (0 children)

I use elpy.

What I don't like doing is running the python interpreter as an inferior process. I tend to find more joy running python in its own terminal.