Skip to content

Commit 9eee2f8

Browse files
Update how-to-use document to provide information on conda env setup (#199)
* Update how-to-use document to provide information on configuring conda environment for running notebooks that were downloaded by clicking on the download icon * Update how-to-use.md Corrected conda environment name. * Update how-to-use.md 2nd attempt to correct name of environment file * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent dabe516 commit 9eee2f8

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

preamble/how-to-use.md

+28-7
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,30 @@ and select “.ipynb”.
8686

8787
That was the easy part. Getting the notebook to execute locally may
8888
take a little more work. The book was created to run in a particular
89-
Python environment, managed with Conda. To ensure success you should
90-
follow the instructions in the Pythia Foundations contributor’s
91-
[guide](https://foundations.projectpythia.org/appendix/how-to-contribute.html)
92-
on how to configure your Python environment. Once your environment
93-
is configured and “activated”, change your working directory to the
89+
Python environment, managed with Conda. If you don't have a up-to-date
90+
version of Conda on your machine, you'll want to install one. A brief
91+
introduction to installing Conda is available [here](https://foundations.projectpythia.org/foundations/conda.html).
92+
93+
Once you've installed Conda you will need to create and activate a Conda environment
94+
that is compatible with Pythia Foundation's notebooks. This
95+
can be done with two commands from the terminal, one to create the
96+
environment and one to activate it:
97+
98+
```
99+
conda env create --force -f https://raw.githubusercontent.com/ProjectPythia/pythia-foundations/main/environment.yml
100+
conda activate pythia-book-dev
101+
```
102+
103+
You should only need to create the environment once (run the first
104+
command above). But if you download another notebook later, you will
105+
need to activate _pythia-book-dev_ if
106+
it is not currently active, for example if you open up a new
107+
terminal window, or deactivate _pythia-book-dev_ explicitly with
108+
the `conda` command. Again, more information on Conda can be
109+
found [here](https://foundations.projectpythia.org/foundations/conda.html).
110+
111+
Now that your _pythia-book-dev_ environment is activated,
112+
change your working directory to the
94113
location where you downloaded the notebook (.ipynb file) and start
95114
the Jupyter Notebook server. For example if you downloaded the
96115
notebook file to your home directory you would do:
@@ -102,11 +121,13 @@ notebook file to your home directory you would do:
102121

103122
A local Jupyter Notebook server should open in your web browser.
104123
Simply open the .ipynb file using the Notebook server’s file browser
105-
and you are good to go. Alternatively, you could “clone the site”
124+
and you are good to go. If you want to work with many Pythia Foundations
125+
notebooks, you might want to “clone the site”
106126
and download all of the notebooks. First click on the Pythia
107127
Foundations GitHub icon (see figure below) and select repository.
108128
Then follow the instructions in our Getting Started with GitHub
109129
[guide](https://foundations.projectpythia.org/foundations/getting-started-github.html#)
110-
for cloning a repository.
130+
for cloning a repository. The steps used above for configuring your
131+
Conda environment should work for this method as well.
111132

112133
![Annotated Pythia Foundations home page](../images/foundations_diagram.png)

0 commit comments

Comments
 (0)