Questions tagged [ipython]
IPython is an interactive shell for Python.
88
questions
0
votes
1
answer
61
views
Prevent completion of the empty string
I would like to prevent completions to the empty string in python and in inferior-python-mode.
To explain a bit better - when the prompt or the string is empty, there are no completions proposed. When ...
0
votes
1
answer
52
views
async/await in emacs?
I'm trying to run a hook that should start after buffers are loaded - it hooks into ein package that starts an "ipython server" that takes some time to start and it seems that the subsequent ...
0
votes
0
answers
44
views
How to wait for buffers to load?
I'm trying to create a hook for ein package that will clean up split windows and focus on the rendered buffer. The package provides one hook (called ein:ipynb-mode-hook), but running functions below ...
3
votes
1
answer
158
views
python-shell-completion-complete-or-indent (Tab, in an inferior python mode shell) completes "__PYTHON_EL_eval_file"
On Emacs 29, Python 3.11.3, IPython 8.13.2
A strange behavior seems to have recently started. When opening a python shell with run-python and then python-shell-send-buffer or python-shell-send-file ...
1
vote
2
answers
239
views
IPython doesn't echo code input
Typically when I send code from a Python script using C-c C-e to IPython, IPython does not echo the code that I input. For example, sending a script with just the following in test.py
2 + 2
and ...
0
votes
1
answer
85
views
ipython shell syntax error with "?" in string in `python-shell-send-string`
When in the IPython shell, ?open returns help on the "open" function. But when I send it with python-shell-send-string it throws a syntax error saying "?" is not recognised. I can ...
0
votes
0
answers
91
views
Getting an error for creating python dedicated shells
Some time ago, I asked this question, which is how to create new python shells that get renamed based on the script from which they are run, e.g., foo.py should create a shell *Python[foo.py]*, and ...
2
votes
0
answers
120
views
IPython interpreter for conda environments on Windows 10
I am using Anaconda3 for managing my environments and the IPython interpreter in Emacs. When activating an environment with pyvenv-activate the completion in the IPython interpreter is not working and ...
0
votes
1
answer
80
views
Dedicated python shells that runs the code
This answer how to map C-c ! to create a new python shell for the current buffer.
The main code is this:
(defun my-python-start-or-switch-repl (&optional msg)
"Start and/or switch to the ...
0
votes
1
answer
967
views
Get process id (pid) for running python (jupyter-kernel)
I've started a jupyter kernel form emacs-jupyter. I'd like to get the process id for the python process associated with the buffer so that I can attach a debugger to it. How can I do this in elisp?
3
votes
2
answers
1k
views
Is there a way to show python generated plots in the python interpreter console?
I use emacs for most python programming, but really miss the inline plot feature combined with printed output in Spyder. See picture.
I've been experimenting with various interpreter settings but ...
0
votes
0
answers
40
views
Why Jupyter console sometimes decide to output sometimes don't?
Problem
I don't know why my Jupyter console sometimes doesn't output anything. An example is this:
Notice that only the first line gets its output. I use C-enter to execute each line. Line 2, 3, 4, ...
0
votes
1
answer
133
views
Emacs (ipython) inferior python shows strange input numbers
In emacs, I use ipython in the inferior python mode with config:
(setq python-shell-interpreter "ipython"
python-shell-interpreter-args "--simple-prompt -i")
When I edit my .py file, without any ...
1
vote
0
answers
102
views
emacs 26 orgmode on win10 can not find jupyter
I am using emacs26(GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)) on win10. I can run jupyter command from shell. but when I run below code:
#+BEGIN_SRC ipython :session test :results output
print("...
1
vote
1
answer
392
views
realgud ipdb how to highlight line being debugged
I debug a python source file with
M-x realgud:ipdb
then call ipdb as python3 -m pdb <sourcepath> <args>
I get 2 windows: ipdb ... shell and my source buffer.
How can I get the line ...
0
votes
0
answers
99
views
Ipython code only executes from org-edit-special, not from org source code block
I am trying to setup emacs on a windows 7 machine, and having trouble executing python/ipython code blocks. I am able to send these code blocks to org-edit-special (C-c '), start a python process (C-c ...
1
vote
2
answers
311
views
Ipython code block producing org table
I saw a python code block example to output an array as an org-table. An example would be,
#+BEGIN_SRC python :results value
r = 3389.5 # km average radius
re = 3396.2 # equatorial radius in km
...
0
votes
0
answers
150
views
ein: [info] Failed to save notebook
I'm using Windows 10, Emacs 26.1, IPython 7.2.0, and ein 20190228.2008. C-x C-s gives the error: ein: [info] Failed to save notebook! . I'm able to save the files through the web interface.
As per #...
3
votes
1
answer
1k
views
orgmode - ipython output image not show in results
I use below org code to draw a graph, but the graph not show on results block:
#+BEGIN_SRC ipython :results drawer :session py2session
%matplotlib inline
import numpy as np
import matplotlib.pyplot ...
1
vote
2
answers
1k
views
emacs and anaconda ipython
I'm trying to get Emacs to start ipython from Anaconda.
I have two systems which are not identical so figured setting symbolic links in ~/bin/ipython as I have ~/bin/ pre-pended to my $PATH would do ...
15
votes
2
answers
6k
views
Integrating jupyter notebook (ipython) into org-mode notebook
is there a way I can link in jupyter notebooks (ipython) into the org-mode notebook? The same way other files (images) can be brought in? If it is possible will the outputs are also seen in the note (...
0
votes
1
answer
26
views
Can I create a shortcut for this operation?
I've been learning emacs the for last few days, trying to get some python development going, until I ran into this. Is it possible to create a shortcut to execute this command specificly? And if yes, ...
2
votes
0
answers
140
views
Disable ipython show output in minibuffer
I am using Ipython 3.6.3 with Emacs(elpy enabled) 25.2.2 on Kubuntu 17.10.
I realize that sometimes output of Ipython keep showing at minibuffer, which is very annoying.
But, I cannot find the value ...
3
votes
0
answers
1k
views
debugging: how to optimize a RealGUD workflow
I code in Python and I my workflow uses debuggers (I coded for 8 years in Matlab).
I develop numerical simulation codes: most of the time it returns a result, the question is: "Is the result right?"
...
5
votes
0
answers
555
views
list of current variables in a buffer for Python code
I would like to find a way to reproduce the "Workspace" of Matlab or the equivalent "Variables" window of the awesome pudb debugger directly in emacs for python code: it is a window which details the ...
0
votes
1
answer
476
views
Problem with emacs and input() using iPython 3.6.4
I am using emacs 25.2.1
Look at the following simple code:
import sys
def yes_no_barrier(message):
print(message + ' (yes/no): ')
while 1:
s=str(input(message + ' (yes/no): '))
...
1
vote
4
answers
2k
views
How to run blocks/cells of python code in emacs?
https://i.stack.imgur.com/TIxlR.png
The picture shows what I mean by "block" - I mean a cell of code that is delimited by some sequence of characters, in this case '#%%', that can be executed by the ...
5
votes
1
answer
936
views
Inferior Python shows not output, or input
I have the symptoms described here Input and Output does not show up in python mode, except this happens with python3 as interpreter as well as ipython, and I've tried the suggestions there for fixing ...
3
votes
2
answers
2k
views
how to set ipython on a virtualenv?
I'm using elpy for my python coding. I wanted to try ipython because of the nice built in profilers. So what I've done is to install ipython within my virtualenv. It works correctly. I then added the ...
3
votes
1
answer
1k
views
ob-ipython error message while evaluating SRC block
I am getting this error when executing any source ipython block such as this one:
#+BEGIN_SRC ipython :session :results output drawer
# Compute areas and colors
import numpy as np
import matplotlib....
1
vote
0
answers
642
views
run python code interactively with emacs 25 on macos
I have always used emacs with python. I generally run my code on the ipython interpreter using C-c C-c.
This is my ~/.emacs.d/init.el in ubuntu where everything works fine.
(setq python-shell-...
1
vote
1
answer
438
views
IPython doesn't work in a virtual environment
I've set up a virtual environment with venv and installed Ipython there via pip. On the terminal it works. Now, in my init.el, I have
(setq python-shell-interpreter "ipython"
python-shell-...
8
votes
0
answers
1k
views
show output from python-shell-send-region
Using python.el and ipython.exe (from Miniconda3), I'd like to highlight a portion of code and execute it in the associated inferior python buffer. Example:
#!/usr/bin/python3
myvar = 100+200
...
5
votes
1
answer
618
views
Dedicated Python Shell?
I just upgraded emacs to 25.3. Before the upgrade when I opened a Python shell, it would ask me whether I wanted a 'dedicated' shell (for the buffer I was in), to which I usually replied 'yes'. Now, I ...
4
votes
2
answers
5k
views
‘python-shell-interpreter’ doesn’t seem to support readline
I am a complete newbie when it comes to emacs. I've got this problem with my 25.2.1 emacs running on Windows 10. Trying to run a python code results in the following error.
Warning (python): Your ‘...
2
votes
0
answers
668
views
Is it possible to have IPython qtconsole open as the default python console in Spacemacs?
Whenever I open a Python script in Spacemacs, I do C-c C-p to launch a console embedded - a console that is, by default, actually an iPython console.
Here is what I would love to be able to ...
1
vote
1
answer
284
views
Python-Repl issues with TRAMP Mode [windows->Linux]
I have an issue when using python-mode remotely through tramp. I'm trying to use the repl and pass a test function
using C-c C-c, however this seems to create a local file at my own computer or ...
3
votes
1
answer
337
views
ipython in emacs: Figure windows “not responding” on Windows 7
I am trying to get a good setup to do scientific python on windows 7. To be complete, I am using Anaconda for Python package management, and emacs 25.2 (the native windows build from GNU, not the ...
1
vote
0
answers
2k
views
Python inline plotting
I'd like to start using Emacs (Spacemacs) for my python work, however, a lot of what I do requires me to interact with the data in the IPython REPL, plot inline graphs, etc.
For example, I might have ...
5
votes
2
answers
7k
views
Spacemacs use anaconda environment
I have anaconda environments for python2 and python3 as I have code written in the different versions
In spacemacs (with python layer installed), when I open ipython (SPC m s i) it starts with my ...
5
votes
1
answer
897
views
Problem of starting a remote ipython console
I want to connect to remote ipython server, and follow the doc of the ipython, I start a ipython server in my server by
ipython3 kernel -f ~/.ipython/kernel.json --pprint
and I can start a ipython ...
1
vote
1
answer
385
views
Spacemacs Python Layer Invalid version syntax: '[?1034h4.0.0'
When I attempt to start Spacemacs with the Python layer enabled, I see a warning:
Error (use-package): python :init: Invalid version syntax: '[?1034h4.0.0'
Restarting emacs using --debug-init shows:
...
6
votes
1
answer
1k
views
Ipython completion in elpy
My elpy uses ipython as the interactive interpreter. It does not, however, emulate ipython's history-informed autocomplete feature (for lack of a better term).
That is: within an ipython session ...
2
votes
0
answers
202
views
Output of ipython shell much slower than python shell
Even turning off font-lock-mode and set (setq python-shell-font-lock-enable nil), the output of an ipython shell
(setq python-shell-interpreter "ipython")
seems much slow than the python shell
(...
0
votes
3
answers
1k
views
ein failed to login to 8888
I was using emacs-ipython-notebook for data visualisation for some days.But then I started getting the error -ein failed to login to 8888.I checked my ipyhton notebook server and it's running on ...
2
votes
0
answers
137
views
Lisp error with elpy under Python 3
I've had my emacs (v. 25.1.1) working with elpy (1.13) under Python 2.7 for a while. I decided to switch to Python 3 recently, and cannot get it to interact with emacs properly. Normally, when I ...
0
votes
1
answer
316
views
Emacs python can not update imported files?
I am using spacemacs, anaconda-mode.
In file main.py, I imported a class from file a.py. Then I pressed C-c C-p to launch an ipython shell, and run main.py, everything is OK. But then I modified the ...
5
votes
1
answer
126
views
How can I access the :file src header argument inside the src block
I'm wondering how to access the :file header argument passed to a src block, from inside the src block itself?
I'm wondering specifically for python, and in this case ipython with %matplotlib inline ...
0
votes
2
answers
524
views
python emacs interpreter doesn't pause for input in loops
This looks like Weird shell output when using IPython 5, but it actually is not. I did set
(setq python-shell-interpreter-args "--simple-prompt -i --pylab")
in .emacs, but I get the following error:...
3
votes
1
answer
173
views
ein + ipython non-responsive with python 'raw_input'
I am using Emacs with the ein package to edit ipython files. Everything works fine except when I have a line like:
fhandle = raw_input('enter your file name: ')
to prompt for a file name. The ...