Skip to content

Commit b40cbe5

Browse files
authored
Merge pull request #935 from devstein/feat/documentation-update
feat(docs): update for newer versions Jupyter notebook
2 parents 67521ea + fa5ed78 commit b40cbe5

File tree

3 files changed

+33
-11
lines changed

3 files changed

+33
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- Enable basic DependaBot scanning for pip packages and GitHub actions used in CI
1010
- Add CI support for release proces with [release.yaml](.github/workflows/release.yml) workflow
1111
- Release documentation is updated acrodingly in [RELEASING.md](./RELEASING.md)
12+
- Update README.md with installation methods on newer Jupyter and JupyterLab releases
1213

1314
## 0.21.0
1415

Dockerfile.jupyter

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,15 @@ RUN if [ "$dev_mode" = "true" ]; then \
3030
cd sparkmagic && pip install -e . && cd ../ ; \
3131
else pip install sparkmagic ; fi
3232

33-
# Jupyter extensions changed in >7.x.x
34-
# For now (workaround), let's pin to 6 to avoid breaking things
35-
# xref: https://github.com/jupyter-incubator/sparkmagic/issues/825
36-
RUN pip install notebook==6.5.5
3733

3834
RUN mkdir /home/$NB_USER/.sparkmagic
3935
COPY sparkmagic/example_config.json /home/$NB_USER/.sparkmagic/config.json
4036
RUN sed -i 's/localhost/spark/g' /home/$NB_USER/.sparkmagic/config.json
41-
RUN jupyter nbextension enable --py --sys-prefix widgetsnbextension
37+
RUN pip install ipywidgets
4238
RUN jupyter-kernelspec install --user $(pip show sparkmagic | grep Location | cut -d" " -f2)/sparkmagic/kernels/sparkkernel
4339
RUN jupyter-kernelspec install --user $(pip show sparkmagic | grep Location | cut -d" " -f2)/sparkmagic/kernels/pysparkkernel
4440
RUN jupyter-kernelspec install --user $(pip show sparkmagic | grep Location | cut -d" " -f2)/sparkmagic/kernels/sparkrkernel
45-
RUN jupyter serverextension enable --py sparkmagic
41+
RUN jupyter server extension enable --py sparkmagic
4642

4743
USER root
4844
RUN chown $NB_USER /home/$NB_USER/.sparkmagic/config.json

README.md

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,52 @@ See the [Sending Local Data to Spark notebook](examples/Send%20local%20data%20to
4848

4949
## Installation
5050

51+
### Jupyter Notebook 7.x / JupyterLab 3.x
52+
5153
1. Install the library
5254

5355
pip install sparkmagic
5456

5557
2. Make sure that ipywidgets is properly installed by running
5658

57-
jupyter nbextension enable --py --sys-prefix widgetsnbextension
59+
pip install ipywidgets
60+
61+
3. (Optional) Install the wrapper kernels. Run `pip show sparkmagic` and it will show the path where `sparkmagic` is installed at. `cd` to that location and run:
62+
63+
jupyter-kernelspec install sparkmagic/kernels/sparkkernel
64+
jupyter-kernelspec install sparkmagic/kernels/pysparkkernel
65+
jupyter-kernelspec install sparkmagic/kernels/sparkrkernel
66+
67+
5. (Optional) Modify the configuration file at ~/.sparkmagic/config.json. Look at the [example_config.json](sparkmagic/example_config.json)
68+
69+
6. (Optional) Enable the server extension so that clusters can be programatically changed:
70+
71+
jupyter server extension enable --py sparkmagic
72+
73+
### Jupyter Notebook 5.2 or earlier / JupyterLab 1 or 2
74+
75+
1. Install the library
76+
77+
pip install sparkmagic
78+
79+
2. Make sure that ipywidgets is properly installed by running
5880

59-
3. If you're using JupyterLab, you'll need to run another command:
81+
jupyter nbextension enable --py --sys-prefix widgetsnbextension
82+
83+
3. If you're using JupyterLab 1 or 2, you'll need to run another command:
6084

6185
jupyter labextension install "@jupyter-widgets/jupyterlab-manager"
6286

63-
4. (Optional) Install the wrapper kernels. Do `pip show sparkmagic` and it will show the path where `sparkmagic` is installed at. `cd` to that location and do:
87+
4. (Optional) Install the wrapper kernels. Run `pip show sparkmagic` and it will show the path where `sparkmagic` is installed at. `cd` to that location run:
6488

6589
jupyter-kernelspec install sparkmagic/kernels/sparkkernel
6690
jupyter-kernelspec install sparkmagic/kernels/pysparkkernel
6791
jupyter-kernelspec install sparkmagic/kernels/sparkrkernel
92+
6893
69-
5. (Optional) Modify the configuration file at ~/.sparkmagic/config.json. Look at the [example_config.json](sparkmagic/example_config.json)
94+
6. (Optional) Modify the configuration file at ~/.sparkmagic/config.json. Look at the [example_config.json](sparkmagic/example_config.json)
7095

71-
6. (Optional) Enable the server extension so that clusters can be programatically changed:
96+
7. (Optional) Enable the server extension so that clusters can be programatically changed:
7297

7398
jupyter serverextension enable --py sparkmagic
7499

0 commit comments

Comments
 (0)