Elpy
emacs-direnv
Our great sponsors
Elpy | emacs-direnv | |
---|---|---|
11 | 11 | |
1,877 | 314 | |
- | - | |
6.0 | 3.2 | |
3 months ago | 14 days ago | |
Emacs Lisp | Emacs Lisp | |
GNU General Public License v3.0 only | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Elpy
-
Issues with setting up elpy
Emacs.............: 28.2 Elpy..............: Not found (Python), 1.35.0 (Emacs Lisp) Virtualenv........: None Interactive Python: python3 3.11.1 (/usr/bin/python3) RPC virtualenv....: rpc-venv (/home/st/.emacs.d/elpy/rpc-venv) Python...........: python nil (/home/st/.emacs.d/elpy/rpc-venv/bin/python) Jedi.............: Not found Rope.............: Not found Autopep8.........: Not found Yapf.............: Not found Black............: Not found Syntax checker....: Not found (flake8) Warnings You have not activated a virtual env. It is not mandatory but often a good idea to work inside a virtual env. You can use `M-x pyvenv-activate` or `M-x pyvenv-workon` to activate one. The Python interpreter could not find the elpy module. Please report to: https://github.com/jorgenschaefer/elpy/issues/new. There was an unexpected problem starting the RPC process. Please check the following output to see if this makes sense to you. To me, it doesn't. :28: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. {"can_connect_to_pypi": true, "rpc_python_version": "3.11.1", "elpy_version": "1.35.0", "jedi_version": "0.18.2", "jedi_latest": null, "rope_version": "1.7.0", "rope_latest": null, "autopep8_version": "2.0.1", "autopep8_latest": null, "yapf_version": "0.32.0", "yapf_latest": null, "black_version": "23.1.0", "black_latest": null} Elpy could not connect to Pypi (or at least not quickly enough) and check if the python packages were up-to-date. You can still try to update all of them:
If you want to stick with Elpy, I'd suggest side-stepping the RealPython tutorial and diving in to Elpy's documentation directly. But keep in mind that the project has been looking for a new maintainer since March of 2021.
- Eglot has landed on master: Emacs now has a built-in LSP client
-
Performant alternative to pyright?
you can use elpy for that its not lsp but it might be faster than pyright.
-
What is your setup for python coding in emacs?
The last commit in https://github.com/jorgenschaefer/elpy master was 16 days ago, so it seems yes.
-
What IDE do you use to code Python?
And I'm using Elpy on Emacs. It works like a charm, which provides (quote from it README): - Code completion - Code Navigation - Interactive evaluation and interactive Python shell - On-the-fly syntax checking - Access to documentation
-
What is your workflow to read opensource software in emacs?
For python development, I use https://github.com/jorgenschaefer/elpy (Elpy is an Emacs package to bring powerful Python editing to Emacs. It combines and configures a number of other packages, both written in Emacs Lisp as well as Python.)
emacs-direnv
- Development Environments with Guix, similar to devenv.sh
-
env-commander.el -- Per-directory env setup for shell commands
env-commander-mode is a simple mode which allows any shell commands that Emacs invokes to run one or more commands beforehand to initialize the shell environment. There are many Emacs packages which can configure process environments, for example, direnv, but they lack the ability to go a step further and define shell functions and aliases, which is often required by "virtual environment" tools. For those who prefer interacting with shell commands via shell-command rather than shell, eshell, or term, env-commander-mode is here to assist.
-
Eglot has landed on master: Emacs now has a built-in LSP client
I've had a good experience with direnv[1] and emacs-direnv[2].
Direnv can automatically load an environment when you enter a directory, so it automatically "opens" virtualenvs/nix shells/etc. The Emacs direnv mode ensures that each buffer sees the direnv mode for its project directory.
I've found this to be a great compromise between automatic behavior on the one hand and transparency + control on the other—I get the right environment loaded automatically very consistently and, if something goes wrong, I can open a shell and poke around to see what's going on (is my nix shell messed up? is the right tool not loaded via direnv? etc). The only time I need to do anything manually is if I make a change to the environment and need to update Emacs about it, in which case I just run M-x direnv-update-environment.
Once I got this set up, I can just rely on executable-find to check for (and find) exactly the right tool on a per-project basis—no more worrying about global or seeing the wrong version of a tool. This also made it easy to do stuff like only run formatting if the corresponding tool is available: I add hooks to various programming language modes that only turn on lsp/formatting/etc if executable-find sees the corresponding executable.
Compared to the hassle I've had to go through helping my colleagues debug VSCode not seeing the right conda environment, virtualenv or the right version of various tools, Emacs + direnv has been a far nicer and more consistent experience.
[1]: https://direnv.net/
-
NixShell + direnv + Emacs
I have this but for flakes and it works perfectly. If you haven't found it yet use emacs-direnv. It will automatically switch the environment when changing directories. If I change something in a flake, I need to use the direnv-update-directory-enviornment to get it to change but other than that just change buffers and it will figure out if you're in a new directory environment or not.
I'm using lorri and emacs-direnv together, works perfectly fine for me.
-
Anyone using sage-shell-mode?
Thanks, I'll check this out if I can't get my ideal setup to work. Presume you meant this: https://github.com/wbolster/emacs-direnv ?
-
Is there a way to configure my Python interpreter to be inside a docker container like in Pycharm?
I first install direnv which allows me to have a different environment per directory, or in my case, a project. And there is a project that connects Emacs to this. https://github.com/wbolster/emacs-direnv
-
Doom Emacs + Pyright + LSP + Conda
I use this to source .envrc files into my emacs environment: https://github.com/wbolster/emacs-direnv
-
I created a gist with a full python config with Emacs
almost. to integrate with a shell, you would indeed hook it onto the shell's prompt function. to integrate it with Emacs, you would use https://github.com/wbolster/emacs-direnv , so Emacs sees the project specific process environment too. the isolation is primarily achieved by setting up a custom PATH, PYTHON_PATH and similar vars
What are some alternatives?
Suplemon - :lemon: Console (CLI) text editor with multi cursor support. Suplemon replicates Sublime Text like functionality in the terminal. Try it out, give feedback, fork it!
envrc - Emacs support for direnv which operates buffer-locally
anakin-language-server - Yet another Jedi Python language server
buffer-env - Buffer-local process environments for Emacs
emacs.d - Fast and robust Emacs setup.
anaconda-mode - Code navigation, documentation lookup and completion for Python.
GNU/Emacs go-mode - Emacs mode for the Go programming language
Code-Server - VS Code in the browser
setup-emacs-windows - A Github Action that installs a specific emacs version
direnv - unclutter your .profile
container-env - Wrapper commands to run inside docker, simulating the behaviour of tools like rvm, rbenv, virtualenv etc...
ppcompile - 🏓ping-pong compile, an Emacs package for coding locally but compiling remotely