Some observations for your problem:
a) FIY: There is only a python
mode, and should be as it is because someone else wrote a python-mode
package here:https://gitlab.com/python-mode-devs/python-mode, which is a totally different thing.
b) You should not do modifications in package's files - at the first update you will loose them. Instead, use an init.el
file, where you make all needed configurations. But, since you already opened/modified the file python.el
, read the comments at the beginning, since there you will find out answer(s) to your question (excerpt from file):
(setq python-shell-interpreter "C:/Python27/python.exe"
python-shell-interpreter-args
"-i C:/Python27/Scripts/ipython-script.py")
Take the above as example and modify paths according to your windows system.
c) You may still have trouble with ipython due to readline and rlcompleter - I do not know the status of that in Windows - but for unix/linux many users set python as inferior shell interpreter instead ipython.
d) To start an inferior Python process use the command M-x run-python
or enable the menu and see what is set and use from there, at least until you get more experienced.
e) In Emacs there are an environment path and an execution path - both should be in sync to work correctly - a small trick to do that is as below:
(setenv "PATH" (concat "your-path-to/anaconda3/bin:"
(getenv "PATH")))
(add-to-list 'exec-path "your-path-to/anaconda3/bin")
Use this at the beginning of python configuration in your init.el file.
f) Try to update your iPpython, mine is version 7.13.0
EDIT
g) It is useful to use use-package
package to configure everything in your Emacs. Example for Python:
(use-package python
:ensure nil
:mode
("\\.py\\'" . python-mode)
:init
(setq-default indent-tabs-mode nil)
:hook
((python-mode . smartparens-mode)
(python-mode . company-mode)
(python-mode . flycheck-mode)
(inferior-python-mode . smartparens-mode))
:config
(setq python-indent-offset 4
python-indent-guess-indent-offset-verbose nil
python-shell-interpreter "python"
;; python-shell-interpreter-args "-i --simple-prompt"
))
Note: The function python-shell-calculate...
is not accessed directly by the user.
C:\anaconda3\Scripts\ipython.EXE
for yourpython-shell-interpreter
variablepython.exe
file in yourpython-shell-virtualenv-root
. You can try 1. not setting thepython-shell-virtualenv-root
at all or 2. setting it toC:/anaconda3/
while giving the full path to thepython-shell-interpreter
as I said earlier. I personally use the packagespyvenv
to managevirtualenvs
(andelpy
) to avoid this kind of hassle. I hope this helps.