You will need to install graphing
(and any other packages required) before you can run the code. This is because graphing
is not a package in Python’s standard library, so you have to install it separately.
Since you already have anaconda installed, you can create an isolated environment to install these dependencies and run the notebook from. Something like:
conda env create --name mslearn jupyter graphing # Add other packages to the end of this line
conda activate mslearn
jupyter notebook
In the above example, mslearn
is the name we give to the environment we create so we can reference it.
Once you have created and activated your conda environment, you can install more packages with one of these two commands:
conda install PACKAGE_NAME # conda native command
pip install PACKAGE_NAME # Using pip instead of conda
Read more about conda environments here:
- Conda environments — conda 22.9.0.post68+583d5564c documentation
- https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf
There may be a requirements.txt
file with the notebooks, wherever you downloaded them from. This is a plain text file that lists all the dependent packages required to run the code that don’t ship with the standard library. You can install those packages into your conda environment like so:
conda activate mslearn # You can skip this if your environment is already active
pip install -r requirements.txt