7,201 questions
Score of 3
1 answer
93 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 ...
Score of 1
0 answers
31 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 ...
Score of 1
1 answer
68 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 ...
Score of 1
1 answer
134 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 ...
Score of 1
2 answers
345 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 ...
Score of 2
1 answer
159 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 ...
Score of 0
1 answer
114 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, ...
Score of 0
1 answer
127 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. ...
Score of 0
0 answers
88 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 ...
Score of 1
1 answer
128 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 ...
Score of 1
1 answer
395 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 ...
Score of 1
1 answer
93 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 ...
Score of -1
2 answers
302 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 ...
Score of 0
0 answers
57 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 ...
Score of 4
5 answers
410 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 ...