Skip to content

Commit ced75a9

Browse files
committed
New recipe to access venv in Jupyter
1 parent 83e21da commit ced75a9

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ VERSION=$(shell git describe --exact-match HEAD 2>/dev/null)
1414

1515
.PHONY: all install clean uninstall again release
1616
.PHONY: info infopath infozsh infobash
17+
.PHONY: notebook-kernel
1718

1819
all: install
1920

@@ -31,6 +32,10 @@ $(STAGPY): setup.py
3132
$(VPIP) install -e .
3233
@$(STAGPY) version
3334

35+
notebook-kernel: $(STAGPY)
36+
$(VPIP) install -U ipykernel
37+
$(VPY) -m ipykernel install --user --name=stagpy-git
38+
3439
info: infopath infozsh infobash
3540

3641
infopath:

docs/sources/developers.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,20 @@ directory of the repository and run::
8686

8787
This should create a PDF file showing a plot of the temperature field with
8888
streamlines.
89+
90+
Use as a Jupyter notebook kernel
91+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92+
93+
If you want to access the virtual environment - and therefore the development
94+
version of StagPy - in a Jupyter notebook, run
95+
::
96+
97+
% make notebook-kernel
98+
99+
This will create a new Jupyter kernel named ``stagpy-git`` you can use to
100+
access the virtual environment in a notebook.
101+
102+
To remove that kernel, run
103+
::
104+
105+
% jupyter kernelspec uninstall stagpy-git

0 commit comments

Comments
 (0)