See C-hv process-environment
List of overridden environment variables for subprocesses to inherit.
Each element should be a string of the form ENVVARNAME=VALUE.
Entries in this list take precedence to those in the frame-local
environments. Therefore, let-binding process-environment is an easy
way to temporarily change the value of an ...
Check the arguments that run-python requires, and supply them in your hook function that calls it (use a lambda with interactive or a named command that you defined). Otherwise, if you want to interact with it then use call-interactively in the mode-hook function.
I think the issue is that RET is probably mapped to comint-send-input, which doesn't do any indentation.
What I do is map C-j to newline-and-indent and leave RET mapped to comint-send-input. So I press C-j to enter a newline, and indent the new line, or RET to actually send the form for evaluation. (Actually I map C-j to paredit-newline, but newline-and-...
(defun run-python-locally (&rest args)
(interactive (progn (require 'nadvice)
(cadr (interactive-form #'run-python)))))
(let ((default-directory user-emacs-directory))
(apply #'run-python args)))
(This uses the trick from this answer).
Additionally, if you'd like to use ...
Two observations related to your configuration:
a) You started with the external package python-mode which may not be what you want.
Instead, try using the internal package python this way:
:ensure nil ;; built-in package
;; the rest of your configuration)
b) To have ipython correctly working, you need to add these lines ...
The problem is eldoc. Emacs ships with global-eldoc-mode set to t and eldoc-idle-delay set to 0.5 seconds. If you are moving around in a file you can generate an awful lot of eldoc calls, which can make emacs unusable over slow or multi-hop ssh connections.
You can start a local python console by executing run-python while in a local buffer (*scratch* will do). The problem is that python interaction will not work for remote files then without some additional hacking.
Generally you need the python process to be running on the same machine that the files reside on
since emacs communicates with the python process ...