7,206 questions
1
vote
1
answer
99
views
Changes to --editable Python libraries require a reset of ipython to be seen [duplicate]
I develop Python libraries (like this one) inside a (mini)conda environment using:
a text editor (VS Code for that matter, but purely as text editor); and
a separate zsh terminal (currently on macOS ...
1
vote
2
answers
248
views
ipython gives wrong traceback when error in a .py file
Python 3.12.2,
IPython 9.7.0,
linux debian.
When an error is found in a .py file, the traceback in ipython does not show the right code snippet, making debugging very difficult. This depends on past ...
2
votes
1
answer
137
views
How to clear output from all cells?
With iPython, is there any way to clear output from all cells? I am looking for a command that can do it in one shot.
I see that clear_out like below can do the cleaning work, but it works for one ...
0
votes
1
answer
82
views
Jupyter notebook shell command/line magic failure does not cause cell failure
I'm using a Jupyter notebook as a tutorial for a command-line tool. However, I noticed that regardless of whether I use a shell command (!) or line magic (%), an error does not cause the cell to fail, ...
0
votes
1
answer
76
views
How to execute a command sent to the IPython terminal in VSCode?
I'm using VSCode with a keybinding that sends a command to the terminal, where IPython is running (not Jupyter Notebook, just plain IPython in the terminal).
I want to select a line of code (e.g. ...
0
votes
0
answers
81
views
numpy TypeError with importing GPflow in ipython
I installed GPflow and just tried to import it with ipython. But, I got an error like below.
---------------------------------------------------------------------------
TypeError ...
1
vote
1
answer
108
views
Jupyter notebook IPython not defined (IPython v 8.30.3 installed)
I'm trying to run a jupyter notebook featuring interactive ipywidgets using a new laptop with a new installation of jupyter/ anaconda, but consistently get the error 'Javascript Error: IPython is not ...
1
vote
1
answer
331
views
Cannot install/run IPykernel in VS Code
I'm new to VS Code and Python. When I tried to use interactive window I failed to install IPykernel. I am using Mac system and have already installed Jupyter and Python in VS Code. I am using conda ...
1
vote
1
answer
82
views
AssertionError: IPython must be installed to use initjs()! Run `pip install ipython` and then restart shap
I installed IPython with pip install ipython and I was able to install it. However PyCharm gives this error:
C:\Users\HP\PycharmProjects\CE475Exercises\CE475Project.py:150:
FutureWarning:
Passing ...
-1
votes
2
answers
269
views
Why doesn't exec() create objects in local/global scope?
I'm trying to find an IPython counterpart to Spyder's runfile. According to this page, "exec() will execute the input code in the current scope" by default. Therefore, I expect the ...
0
votes
0
answers
29
views
Use trace module from Spyder console
I was looking for how to echo commands to the console as a Python script is executing. Google pointed me to the trace module, but what I found online shows that it must be specified when invoking ...
0
votes
0
answers
48
views
How to interrupt a while loop using a button click with Jupyter Notebook
I have a dashboard that gets node count, etc. from slurm and displays that as a button grid, and is refreshed every n seconds. I want the ability to click on any of the buttons and have something ...
4
votes
5
answers
367
views
How to use Jupyter notebooks or IPython for development without polluting the venv?
Best practice for Python is to use venv to isolate to the imports you really need. I use python -m venv.
For development, it's very convenient to use IPython and notebooks for exploring code ...
0
votes
0
answers
119
views
%store -r returns "TypeError: 'PickleShareDB' object is not subscriptable"
I have a string variable I've defined in one Jupyter notebook that I'd like to use in another Jupyter notebook. I know from here that %store is an approach, but when I use %store -r <variable> ...
0
votes
0
answers
93
views
python/Jupyter-lab: How to use built-in JSON visualization functionality for a dataclass
IPython/Jupyter has built-in functionality to visualise JSON structures as an interactive tree where you can expand and collapse nodes. I like using it for lists and dictionaries, but now I want to ...