Questions tagged [python]

use for Python programming language in Emacs. Emacs supports several versions of the language implementation, versions, and coding styles. Python questions should augment with additional tags as appropriate as described in the description below.

Emacs already has out-of-the-box Python support via python-mode and there are a number of Python major modes for Emacs. Emacs provides basic editing and IDE-like features by using a combination of native Emacs features and external Emacs/Python packages:

  • python.el comes with Emacs versions 24.2 and later
  • python-mode.el
  • loveshack python.el for Emacs versions 24.1 and before

When tagging questions with , mention Emacs and Python package versions.

For IDE-related questions, mention which of these packages as well:

  • Elpy
  • anaconda-mode
  • Spacemacs Python layer, which is based on anaconda-mode
  • python-mode.el, which replaced python-mode in python.el

Questions about Python interactive shells and REPLs should tag them with as well.

612 questions
70
votes
5 answers

How do you create a robust Python IDE with Emacs (as the Text editor)

Emacs is an excellent editor - however it is said "to program you first need an IDE" - so how would you build an IDE in the extensively customizable Emacs for PYTHON with all the features of modern IDE. I want to be able to effectively debug, run…
Serial Exchangist
  • 851
  • 1
  • 7
  • 7
39
votes
3 answers

How to set up elpy to use python3?

When setting up my emacs for a new work environment, I am unable to get the elpy configuration to correctly use python 3. I have installed all of the required packages in /usr/local/bin and have installed them using python3. Right now, when I run…
adam
  • 491
  • 1
  • 4
  • 3
30
votes
10 answers

How do use Emacs to look up a function in Python?

What is the easiest way to configure Emacs to be able to look up where a function is defined? I want to highlight it in Emacs and press a key combo to look up where the source of the function is. Can you also find out where a specific function is…
Low Kian Seong
  • 413
  • 1
  • 4
  • 6
27
votes
2 answers

Using conda environments in emacs

What is the best way to use conda environmets using emacs as a Python IDE? I have got different conda environments while programming in Python: $ conda info -e # conda environments: # django /Users/Pablo/anaconda/envs/django scipy …
PabloRdrRbl
  • 435
  • 1
  • 4
  • 7
26
votes
2 answers

Python org-mode source block output is always ': None'

This is my source block: #+BEGIN_SRC python print "hello" #+END_SRC The output is always: #+RESULTS: : None This is my org-babel configuration: (org-babel-do-load-languages 'org-babel-load-languages '((python . t) (C . t) (calc . t) …
Empty_Mind
  • 1,341
  • 12
  • 27
19
votes
4 answers

Your ‘python-shell-interpreter’ doesn’t seem to support readline

I've got this problem with my 25.1 and Python 3.5 on Ubuntu 16.10, but I don't see it being solved anywhere. Wondering what the latest status was. Reproducing: > emacs -Q --eval '(setq python-shell-interpreter "python3")' then M-x run-python…
147pm
  • 2,907
  • 1
  • 18
  • 39
19
votes
2 answers

Can I include a common code block in two different code blocks in Org mode?

I have an org-mode file containing a table of data and two Python code blocks to extract different summaries from it. I would like to share some common constants and functions between these two code blocks. Ideally, I'd do this by factoring out the…
user1968
18
votes
2 answers

Display errors and warnings in an org-mode code block

I would like to be able to report warnings and errors when evaluating a Python code block in an Org file. When a code block has Python syntax errors, Org helpfully pops them up in a separate buffer called *Org-Babel Error Output*. It would be…
user1968
17
votes
2 answers

Make fill-paragraph in python docstring leave the triple-quotes on separate line

I type a python docstring all on one line like this: """ This is a long docstring. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante…
bstpierre
  • 280
  • 2
  • 10
13
votes
1 answer

org-mode: how can i point to python3.5 in my org-mode doc?

On: Aquamacs 3.3 GNU Emacs 25.1.1 (x86_64-apple-darwin14.1.0, NS appkit-1344.72 Version 10.10.2 (Build 14C109)) of 2016-09-19 in mac osx sierra I changed my ~/Library/Preferences/Aquamacs Emacs/Preferences.el with the below: (setq…
Cy Bu
  • 481
  • 4
  • 14
13
votes
3 answers

How to transpose two arguments of a function in Python?

How I can I swap two arguments in a call to a Python function? If I put point on the space between these two arguments: self.assertEqual(json.loads(some.data), json_data) and then M-t (transpose-words), I…
Croad Langshan
  • 3,192
  • 14
  • 42
12
votes
3 answers

Is there a way to use python instead of elisp for extending emacs?

I'm interested in using languages other than elisp to write emacs extensions, is this possible at all? If python is not supported, what languages are?
nukeop
  • 133
  • 1
  • 5
12
votes
4 answers

Library for automatically inserting python docstring in Google style

I'm looking for an elisp package that automatically inserts Python docstring for a method. I found a package, which is very close to my purpose. But it's in reStructured text, not in Google…
sy2
  • 123
  • 1
  • 4
12
votes
3 answers

Two Python modes

I have been trying to configure Emacs to use the proper Python mode. To this end I have read a few tutorials. Most importantly this one. The tutorial uses the python-mode package. However, when I install it through the package manager (M-x…
11
votes
3 answers

Emacs EIN vs IPython shell

I'm trying to make EIN work within Emacs, but right now (with IPython 2) it seems that it's not possible. This errors arise: REQUEST [error] Error from parser ein:json-read: (json-readtable-error) ein: [error] Error (parse-error) while opening…
El Diego Efe
  • 1,601
  • 1
  • 19
  • 24
1
2 3
40 41