-
Notifications
You must be signed in to change notification settings - Fork 0
Installation guide (offline)
There is no need to follow any installation process if you are using Google Colab. Instructions below are for setting it up yourself.
The exercises use Jupyter notebooks. These provide a nice GUI interface to Python. You need to do a few steps:
For regular off-line use you should consider installing a Jupyter Notebook/Python environment directly on your laptop. This will provide you with reliable off-line access to a computational environment. This will also allow you to install additional code libraries to meet particular needs.
Choosing this option will require an initial software installation and routine updates. For this course the recommended package is Anaconda. Downloading and installing the software is well documented and easy to follow. Allow about 10-30 minutes for the installation depending on your connection speed.
After installing be sure to check for updates before proceeding further. With the Anaconda package this is done by executing the following two commands in a terminal window:
conda update conda
conda update anaconda
- Open your web browser and navigate to the GitHub repository you want to download. (https://github.com/University-Clinic-of-Neuroradiology/python-bootcamp)
- Click on the green "Code" button and select "Download ZIP". This will download the repository as a zip file to your local machine.
Once the download is complete, navigate to the folder where the zip file was downloaded. Right-click on the zip file and select "Extract All...". Choose a destination folder for the extracted files and click "Extract". This will unzip the contents of the repository into the specified folder.
-
Open the Anaconda Prompt from the Start menu. This will open a command prompt with the Anaconda environment activated.
-
Use the
cd
command to navigate to the folder where you extracted the GitHub repository. For example:cd path\to\extracted\repository
Replace
path\to\extracted\repository
with the actual path to the folder where you extracted the repository. -
Once you're in the correct folder, you can proceed with your project-specific commands, such as creating a virtual environment or installing dependencies.
So, let's create a virtual environment to isolate our project dependencies.
Open a terminal or command prompt and execute the following command:
conda create --name myenv python=3.8
Replace myenv
with your preferred environment name. This command will create a new virtual environment named myenv with Python 3.8 installed.
To activate the virtual environment, run:
conda activate myenv
So, let's install packages from a requirements.txt file using pip.
- Navigate to your project directory where the requirements.txt file is located.
- Activate the virtual environment if you haven't already done so:
conda activate myenv
- Install packages from the requirements.txt file using pip:
pip install -r requirements.txt
This command will read the requirements.txt
file and install all the specified packages along with their dependencies into your virtual environment.
Once the installation is complete, you can verify that the packages are installed correctly by running:
pip list
By following the steps outlined in this guide, you've successfully created a virtual environment using Conda and installed packages from a requirements.txt file using pip. This approach allows you to manage dependencies efficiently and ensure project reproducibility.