7,203 questions
3
votes
1
answer
76
views
How can I use asyncio in a script that I also run as a Jupyter notebook?
I often create Jupyter notebooks as plain .py files with # %% cell delimiters, like this:
# %%
import polars as pl
import numpy as np
# %%
df = pl.read_parquet('my_cool.parquet')
...
I can then run ...
0
votes
0
answers
23
views
DLL initialization routine failed on package import
I have tried loading PyTorch in iPython but get a DLL initialization error. In a normal python console it works fine, as below. Windows 10, Miniconda installation.
Can anyone advise how I need to ...
1
vote
1
answer
67
views
Trying to import numpy inside custom library
i have working on ipynb file, and in a cell i calling custom method from my custom library called mymodule. That method calling np.polyfit() which are import in first line of mymodule import numpy as ...
1
vote
1
answer
114
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
301
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
144
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
101
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
103
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
83
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
116
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
360
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
86
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
290
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
53
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
391
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 ...