Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 78 additions & 12 deletions Installation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,107 @@
"To follow along with this tutorial and write (and run!) your own Python code,\n",
"Python needs to be installed, as well as Jupyter Notebook and some other\n",
"Python-based packages.\n",
"There are several ways to install these applications and packages, outlined below.\n",
"After installing these applications, you should test that everything works as\n",
"expected.\n",
"\n",
"## Install the Anaconda distribution of Python\n",
"If at any point you need help with installation, please [reach out to the Centre for Digital Scholarship][help].\n",
"\n",
"We strongly advise you to [install the free Anaconda distribution of Python 3][install].\n",
"Next to Python itself, the Anaconda distribution also contains Jupyter Notebook, an environment that can be used to document and to execute Python code. We will use Jupyter Notebook in this course.\n",
"[help]: <mailto:cds@library.leidenuniv.nl?subject=Help with Python installation>\n",
"\n",
"The [installation instructions][install] link to separate instructions for Windows, Mac and Linux.\n",
"\n",
"[install]: https://docs.anaconda.com/free/anaconda/install/\n",
"## Install Python\n",
"\n",
"Python is a programming language that requires an interpreter to run your code.\n",
"In this course, we use Jupyter Notebook to create *notebooks* that contain code and formatted text\n",
"and to run the code interactively.\n",
"Some parts of the course also require external packages.\n",
"\n",
"There are several ways to install these prerequisites:\n",
"\n",
"- [Install the Anaconda distribution](#install-the-anaconda-distribution-of-python).\n",
" Anaconda is a commercial distribution of Python that includes Jupyter Notebook and the packages we use.\n",
"- [Install Python and the other applications separately](#installing-python-and-jupyter-notebook-without-anaconda).\n",
" This requires less storage space, but more manual steps.\n",
"- Do not install anything, but [use a hosted Jupyter Notebook environment](#working-with-a-hosted-version-of-jupyter-notebook).\n",
" This requires a stable internet connection, potentially an account for the service and managing files on the remote system.\n",
"\n",
"### Install the Anaconda distribution of Python\n",
"\n",
"Anaconda is a commercial distribution of Python that includes Jupyter Notebook and the packages we use.\n",
"It is free for educational purposes, but using it in other contexts may require a paid subscription.\n",
"\n",
"If you use a laptop that is managed by Universiteit Leiden, it is possible that you can install Anaconda through the software center directly, or request it to be installed via the ISSC Helpdesk portal.\n",
"See [Install or request software](https://helpdesk.universiteitleiden.nl/tas/public/ssp/content/detail/service?unid=a2cd7b3a383b47cb8f14e336c6d9b06d) on the university website for more information.\n",
"\n",
"Otherwise, [install the free Anaconda distribution of Python 3][install] from the Anaconda website.\n",
"There are instructions for Windows, MacOS and Linux.\n",
"\n",
"[install]: https://www.anaconda.com/docs/getting-started/anaconda/install\n",
"\n",
"See Anaconda's installation instructions for some important points to consider during installation. For example, the installation path must not contain spaces. If you want to use Anaconda Python from the command line, it helps to add Anaconda to your PATH during the installation, even though this is not recommended by the installer.\n",
"\n",
"## Test your installation\n",
"#### Test your Anaconda installation\n",
"\n",
"If the installation process was successful, you should be able to open an application named 'Anaconda Navigator'. The opening page of this application looks as follows:\n",
"\n",
"![Anaconda Navigator launcher screen](nav-tabs.png)\n",
"\n",
"Anaconda Navigator is a platform which can be used to to launch other applications, such as 'Jupyter Notebook' or 'Spyder'. \n",
"Anaconda Navigator is a platform which can be used to to launch other applications, such as 'Jupyter Notebook' or 'Spyder'.\n",
"\n",
"To test whether everything works well, launch 'Jupyter Notebook' using Anaconda Navigator. Jupyter Notebook is an interactive environment in which you can work with so-called notebooks. The application should open in a web browser.\n",
"\n",
"### Installing Python and Jupyter Notebook without Anaconda\n",
"\n",
"You first need to make sure that Python is installed correctly on your computer.\n",
"\n",
"If you use a laptop that is managed by Universiteit Leiden, it is possible that you can install Python through the software center directly, or request it to be installed via the ISSC Helpdesk portal.\n",
"See [Install or request software](https://helpdesk.universiteitleiden.nl/tas/public/ssp/content/detail/service?unid=a2cd7b3a383b47cb8f14e336c6d9b06d) for more information.\n",
"\n",
"Otherwise, [download the latest version of the Python installer](https://www.python.org/downloads/) and run the installer.\n",
"There are [installation instructions for various operating systems](https://wiki.python.org/moin/BeginnersGuide/Download) in the Beginner's Guide.\n",
"\n",
"Once Python is installed, open *Terminal* on MacOS or the *Command Prompt* on Windows (*Start > All Programs > Accessories > Command Prompt*).\n",
"Type the following:\n",
"\n",
" pip install notebook\n",
"\n",
"\n",
"After this, you can test whether the installation was successful by typing:\n",
"\n",
" jupyter notebook\n",
"\n",
"Jupyter Notebook should then open in your default web browser, potentially after a short delay.\n",
"\n",
"### Working with a hosted version of Jupyter Notebook\n",
"\n",
"In case it is not possible to install software on your laptop, using an online Notebook environment may help.\n",
"Each service has its advantages and disadvantages, compared to a local installation.\n",
"You will need an account and will need to manage getting your files on the service and getting the results back to your computer. \n",
"Some services automatically end interactive sessions when users are not interacting for a certain amount of time.\n",
"When that happens, unsaved changes may be lost.\n",
"\n",
"Researchers at Universiteit Leiden can use the [Interactive Notebooks service provided by the EU-funded European Open Science Cloud](https://open-science-cloud.ec.europa.eu/services/interactive-notebooks) for free.\n",
"It requires the setup of the [File Sync and Share service](https://open-science-cloud.ec.europa.eu/services/file-sync-share) so that you can upload and download notebooks and other files.\n",
"When you save your notebooks in Jupyter Notebook, they will be stored in the File Sync and Share service.\n",
"\n",
"Another hosted notebook environment is [Google Colab](https://colab.research.google.com/).\n",
"While this platform does not use *Jupyter* Notebook, it works in the same way.\n",
"You have to have a Google account to use it and you must connect Colab to Google Drive for storing notebooks and other files.\n",
"\n",
"To test whether everything works well, launch 'Jupyter Notebook' using Anaconda Navigator. Jupyter Notebook is an interactive environment in which you can work with so-called notebooks. The application should open in a web browser. \n",
"## Jupyter Notebook interface\n",
"\n",
"When you open Jupyter Notebook, you should initially see the application's dashboard. \n",
"When you open Jupyter Notebook, you should initially see the application's dashboard.\n",
"\n",
"![Jupyter Notebook files dashboard](dashboard_files_tab.webp)\n",
"\n",
"This dashboard displays a specific driectory on your own machine. The folders and files that are mentioned will probably be different from those shown in the screenshot above. \n",
"This dashboard displays a specific driectory on your own machine. The folders and files that are mentioned will probably be different from those shown in the screenshot above.\n",
"\n",
"From the directory you see, you can hopefully navigate to the folder containing all the notebooks you downloaded for this tutorial. Try to open the notebook named '**Jupyter_notebook_basics.ipynb**' to test whether everything works as expected. \n",
"From the directory you see, you can hopefully navigate to the folder containing all the notebooks you downloaded for this tutorial. Try to open the notebook named '**Jupyter_notebook_basics.ipynb**' to test whether everything works as expected.\n",
"\n",
"## Ask for help with installation\n",
"\n",
"If you experience difficulties during the installation of this software, do not hesitate to [contact the CDS via email](mailto:cds@library.leidenuniv.nl). If necessary, you can make an appointment and ask us to help you install the software. \n"
"If you experience difficulties during the installation of this software, do not hesitate to [contact the CDS via email](mailto:cds@library.leidenuniv.nl). If necessary, you can make an appointment and ask us to help you install the software.\n"
]
}
],
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
jupyter-book>=0.12.0
requests
pandas
beautifulsoup4
seaborn