Skip to content

Commit 4d7f574

Browse files
committed
Add installation guide for mayavi
1 parent 18fb9d3 commit 4d7f574

2 files changed

Lines changed: 27 additions & 7 deletions

File tree

src/05-hartree_fock/02-plot_grid_data.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,35 @@ We will use the
1010
[Mayavi](https://docs.enthought.com/mayavi/mayavi/)
1111
package to plot grid data.
1212
13-
This can be installed with
13+
The installation of mayavi is a bit tricky, as it requires some
14+
specific versions of its dependencies. The easiest way to install it is
15+
to install it in a fresh python 3.11 environment
16+
```bash
17+
mamba create -n mayavi python=3.11 mayavi
1418
```
15-
mamba install -c conda-forge mayavi
19+
Afterwards, activate the environment with
20+
```bash
21+
mamba activate mayavi
1622
```
17-
If you wish to use Mayavi with Jupyter notebooks, you will need to install
18-
the ipyevents package with
23+
Confirm that you are in the environment with
24+
```bash
25+
which python
1926
```
20-
mamba install -c conda-forge ipyevents
27+
Once in the environment, you can install the other dependencies like this:
28+
```bash
29+
mamba install numpy scipy
2130
```
31+
32+
If you wish to use Mayavi with Jupyter notebooks, you will need to install
33+
an older version of Jupyter notebooks along with some other packages:
34+
```bash
35+
mamba install "notebook=6.5.*" ipywidgets ipyevents
36+
```
37+
38+
However, if you are using MacOS, this will not let you use the
39+
Mayavi together with Jupyter notebooks, and there is no easy way to fix it.
40+
Therefore, you should use Mayavi with the "classic" Python.
41+
2242
~~~
2343

2444
### Functions for Isosurface Plotting
@@ -30,7 +50,7 @@ We start by importing the necessary packages.
3050
```
3151
~~~admonish tip
3252
If you are using Jupyter notebooks, you will need to run the following cell
33-
to initialize Mayavi immediately after importing it:
53+
to initialise Mayavi immediately after importing it:
3454
```python
3555
mlab.init_notebook()
3656
```

src/codes/05-hartree_fock/mo_and_density.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
mol.get_basis('sto-3g')
2828

2929
rhf = HartreeFock(mol)
30-
rhf.initialize()
30+
rhf.initialise()
3131
e_scf = rhf.run_hf(verbose=0)
3232
### ANCHOR_END: water_hf
3333

0 commit comments

Comments
 (0)