Python 3 with Emacs
Asked Answered
M

3

23

Is there anything that should be done to make GNU Emacs 23.2 work well with Python 3?

How would an ideal environment for development with Python 3 in Emacs look like?

Is there any documentation about using ropemacs with Python 3?

Should I add Python 3's site-packages directory to the python path?

Will following the instructions here (for python-mode.el) or setting python-python-command to python3 for python.el affect pymacs or ropemacs?

EDIT: From GNU Emacs 23.2's python.el (authored by Dave Love):

;; Fixme: This doesn't support (the nascent) Python 3

How well does python-mode.el support it?

Metallo answered 17/7, 2010 at 8:10 Comment(2)
Not sure what you want to do? Edit in Emacs, then run outside emacs, or run inside emacs. More clarity on WHAT you want to do inside emacs might make your question easier to answer.Decca
It seems like the proper discussion is "What would an ideal environment for development with Python 3 in Emacs look like?" The EmacsWiki is a mess.Phallus
M
9

From Loveshack python.el:

There is support for editing both Python 2 and Python 3 languages, and using interpreters for either version to run the emacs.py module in inferior processes.

From README file for Pymacs (notes for 0.24 beta 2):

The biggest change is Python 3 support. This required new installation mechanics, and a Python pre-processor written for the circumstance (named pppp).

It seems that ropemacs will soon support py3k as well.

Also I hope to see ports of ropemode and ropemacs/ropevim to py3k; they should be a lot easier to do, since it involves mostly syntax fixes, AFAICT.

CEDET also seems to support Python (3?) at this point.

Given checkers that support py3k, flymake will work with emacs, too. Auto complete mode can be made to support py3k as well, provided its sources work with it.

Metallo answered 17/7, 2010 at 8:10 Comment(1)
This comment indicates that ropemacs support for py3k is still lacking.Smelter
S
4

ropemacs is specifically for refactoring python code in Emacs. pymacs is sort of like an API for communication between EMACS Lisp and Python.

ropemacs uses pymacs to allow for giving refactoring capabilities in Emacs.

The instructions are for directly developing in Python using Emacs. If you are looking to directly develop with Python in Emacs, I would recommend directly using the following link: https://launchpad.net/python-mode

It puts Emacs in python mode for development. You will need to apply the patch in the instructions link since there are still bugs with using the python-mode directly in Emacs. Hope that helps.

Sigler answered 21/7, 2010 at 14:4 Comment(0)
J
1

Both Python-modes support Python3

If python3 is not your default Python-shell

M-x python3(VERSION) will open an interactive shell at python-mode.el

When a shebang shows python3, it's recognised.

Maybe set Emacs Python defaults

py-shell-name at python-mode.el

python-shell-interpreter in Emacs-24.3 python.el

python-python-command in previous python.el

If python-mode.el is not available, get it here:

https://launchpad.net/python-mode/+download

Jacinthe answered 17/7, 2010 at 8:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.