Hot answers tagged

25 votes

How to set up elpy to use python3?

You can conffigure elpy-rpc-python-command. If you want Python3 you can set it like this. (setq elpy-rpc-python-command "python3") Update Create python3 virtualenv using virtualenvwrapper from ...
user avatar
8 votes
Accepted

how to remove the red underline

When you spot a problem in the way how emacs behaves and if that happens only when you load your emacs config (init.el or .emacs) and not when you run emacs -Q, you need to bisect your init to find ...
user avatar
  • 24.3k
8 votes
Accepted

How to customize the line character length in elpy?

If you want to customize per project basis, you can create a setup.cfg with custom config like this [flake8] max-line-length = 160 If you want to change this globally, you can change flake8 config as ...
user avatar
8 votes

How to set up elpy to use python3?

You can solve this by modifying the python shell configuration from python to python3 in elpy-config M-x elpy-config to enter the configuration page of elpy if you scroll down you will see groups ...
user avatar
8 votes
Accepted

flymake : How can I modify/ignore syntax and styling rules?

flymake uses flake8 to check the errors, so you have to tell flake8 which errors you don't want to see. You can do that globally by creating the file ~/.config/flake8, with the following content: [...
user avatar
  • 1,914
6 votes

Ipython completion in elpy

I don't use eply, I use emacs 25.1.1 with company-jedi with the following: (setq python-shell-interpreter "ipython3" python-shell-interpreter-args "--simple-prompt --pprint") Inside emacs *Python* ...
user avatar
6 votes

How can I defer loading elpy using use-package?

The author of elpy suggests doing this via an advice, because elpy-enable modifies the python-mode-hook variable, so calling it inside the mode-hook is too late: https://github.com/jorgenschaefer/elpy/...
user avatar
  • 161
5 votes
Accepted

Function to restart python console

Well I figured it out: kill-process kills the process as a side effect, so it returns before that is really killed. So a function like this works: (defun my-restart-python-console () "Restart ...
user avatar
  • 878
5 votes
Accepted

how to set ipython on a virtualenv?

Reading the docstring for the deprecated elpy-use-ipython, it points to https://elpy.readthedocs.io/en/latest/ide.html#interpreter-setup that recommends the following setup for ipython: (setq python-...
user avatar
  • 2,813
5 votes

Annoying "error in process filter: Overlapping strings detected"

There's a workaround suggested in https://github.com/jorgenschaefer/elpy/issues/1381#issuecomment-434313600 Adding (setq elpy-eldoc-show-current-function nil) to my emacs init file makes it stop ...
user avatar
4 votes

Function to restart python console

If you're using ipython, why not just use the baked-in %reset magic command? You can also use: %load_ext autoreload %autoreload To automatically reload imported modules on change.
user avatar
  • 1,501
4 votes
Accepted

How to customize files pattern while using rgrep?

rgrep takes as its second argument file description in a format similar to shell globbing, which also exists in other languages, for example, in Python. There's also a useful variable in Emacs ...
user avatar
  • 10.9k
4 votes
Accepted

How to start python shell in appropriate working directory?

This should be fixed as of the docs By default, Elpy tries to find the root directory of the current project (git, svn or hg repository, python package or projectile project) and starts the python ...
user avatar
  • 794
4 votes
Accepted

Elpy Dependecies in Virtual Env

You can install jedi/yapf packages in a separate virtualenv and just add $VIRTUAL_ENV/lib/python*/site-packages/ to your PYTHONPATH or to your virtualenv using add2virtualenv. Make sure you are using ...
user avatar
4 votes

elpy not picking up virtualenv

To work on a virtual environment, you need to call M-x pyvenv-workon and then select the preferred working environment. There is no need to install other packages as elpy comes with pyvenv package.
user avatar
4 votes

Elpy doesn't recognize I have virtualenv installed

(setq elpy-rpc-virtualenv-path 'current) works for me.
user avatar
  • 1,106
3 votes

elpy with ipython as rpc -- how to get good autocompletion

Elpy doesn't require emacs jedi package. Also they won't work well when both are configured. I guess there is some conflict between them. Use only elpy and you should be able to get completion in rpc ...
user avatar
3 votes
Accepted

Docstrings don't automatically indent themselves in elpy-mode. How do I fix this?

elpy has a function elpy-open-and-indent-line-below which is binded to <S-return>. After """, you can hit <S-return> to open new line and indent automatically. You can use this at the end ...
user avatar
3 votes
Accepted

emacs: reinstall package after installation error

Have you tried to delete elpy package from M-x list-packages? You can do it by pressing d on the elpy package, and then pressing yes to confirm the action. If you already did that, you can go to ~/....
user avatar
3 votes

Make elpy-shell-send more intelligent

I haven't tried this thoroughly, but should work: 1. if region is active, evaluate it (this currently works), goto 3. 2. if region not active, evaluate current statement, goto 3. 3. Jump to the ...
user avatar
3 votes

Autocompletion using company in org src buffer?

The problem is ultimately the result of misunderstanding how completion works with company mode. I temporarily solved it by adding an import statement to the top of the org-babel block. That is, ...
user avatar
3 votes
Accepted

How to use elpy and non-python autocomplete

You should be able to just enable company-mode globally without any problems with Elpy (if there are any, please do file a bug report!). You can also use auto-complete in buffers other than Python ...
user avatar
3 votes
Accepted

Why does company autocomplete 1000 to "and"?

This is an old bug. It has been resolved with this patch: https://github.com/jorgenschaefer/elpy/pull/1279
user avatar
3 votes

Set RPC Python when using elpy with virtualenv

You can set elpy-rpc-virtualenv-path: Path to the virtualenv used by the RPC. Can be ‘default (create a dedicated virtualenv .emacs.d/elpy/rpc-venv), ‘system (use the system environment), ‘...
user avatar
  • 151
3 votes
Accepted

Python over-indentation warning E127

You should create in your home folder a .flake8rc file, and add some content to ignore that error - documented here and below is a small template: [flake8] # it's not a bug that we aren't using all ...
user avatar
  • 1,076
3 votes

Elpy Configuration...Setting Up a Virtual Environment and Pip Conflic with Conda? Need hand holding

Step 1: If you haven't already done so, go ahead and create a new conda environment. Let us say we want to create an anaconda environment with name py38 which uses python 3.8. Execute the following in ...
user avatar
2 votes

How can I defer loading elpy using use-package?

I think it is possible with :after (use-package python :ensure t :defer t :mode ("\\.py\\'" . python-mode)) (use-package elpy :ensure t :after python :config (elpy-enable))
user avatar
2 votes
Accepted

Emacs 24 with Elpy 1.7.50 does not recognize Python Project

Elpy knows of two "roots" for your directory, the "project root" and the "library root". The project root is used for file searches and similar, while the library root is the directory added to sys....
user avatar
2 votes

How to set up elpy to use python3?

Set the interpreter variable in your .emacs file: (setq python-shell-interpreter "python3" python-shell-interpreter-args "-i") Taken from elpy manual
user avatar
  • 21

Only top scored, non community-wiki answers of a minimum length are eligible