Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Material for a Jupyter-based Python tutorial, with Introductory, Advanced, Libraries modules

License

NotificationsYou must be signed in to change notification settings

SerAcero/python-tutorial

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RenkuBinder

Build Docker container

Open in GitHub Codespaces

Run the tutorial on your computer

You have two ways in which you can run the tutoriallocally.

1. With aconda environment

0. Prerequisites

To run the tutorial locally, you should first installconda (ormamba).

It is also suggested that you have a recent version ofgit. Check outhow to installgit on your operating system.

1. Download the material

Go to the directory on your machine where you want to download the material and clone the repository:

git clone https://github.com/empa-scientific-it/python-tutorial

Alternatively, you can manually download a ZIP archive with the latest version of the material:

Download ZIP archive

Extract the archive in a directory of your choice.

2. Create a dedicated environment

Enter the tutorial folder with

cd /path/to/python-tutorial

You should now create a new environment withconda:

conda env create -f binder/environment.yml

Warning

If you are on Windows and using Command Prompt or the PowerShell, please make sure to adjust the paths in the commands above accordingly.

Then activate the environment with

conda activate python-tutorial

You can update the existing environment (that is, downloading the latest version of the packages) with:

conda env update -f binder/environment.yml

3. Launch the tutorial via Jupyter

Finally, launch JupyterLab with

jupyter lab

2. With Docker

Note

The following instructions are for Windows. With minor changes, the steps work on macOS or Linux as well.

  1. Install Docker Desktop: First, you need to install Docker Desktop on your Windows machine. You can download it from the official Docker website:https://www.docker.com/products/docker-desktop.

  2. Create a folder: Open File Explorer and create a new folder where you want to save the tutorial's materials. For example, you could create a folder called "python-tutorial" on your Desktop.

  3. Open PowerShell: Once Docker Desktop is installed, open PowerShell on your Windows machine. You can do this by pressing the "Windows" key and typing "PowerShell" in the search bar.

  4. Pull the Docker image: In PowerShell, run the following command to pull the Docker image:

docker pull ghcr.io/empa-scientific-it/python-tutorial:latest

Note

Thelatest tag points to the CPU-only variant of the image, which is optimized for size and compatibility. If you have a CUDA-compatible GPU and want to use GPU acceleration for PyTorch operations, you can use the CUDA-enabled variant by replacinglatest withcuda:

docker pull ghcr.io/empa-scientific-it/python-tutorial:cuda

Important

Using the CUDA variant requires a NVIDIA GPU with compatible drivers properly installed and configured for Docker. SeeNVIDIA Container Toolkit for setup instructions.

  1. Run the Docker container: Once the image is downloaded, run the following command to start a Docker container from the image:
docker run -p 8888:8888 --name python_tutorial -v /path/to/python-tutorial:/home/jovyan/python-tutorial ghcr.io/empa-scientific-it/python-tutorial:latest jupyter lab --ip 0.0.0.0 --no-browser

Note

If you pulled the CUDA variant, replace:latest with:cuda in the command above.

Replace/path/to/python-tutorial with the path to the folder you created in step 2, for exampleC:/Users/yourusername/Desktop/python-tutorial.

Note

The above command willmirror the content of your local folder (e.g.,C:/Users/yourusername/Desktop/python-tutorial) to the~/python-tutorial folderinside the container. In this way, every file or folder you copy or create into~/python-tutorial will be saved on your machine, and will remain thereeven if you stop Docker.

  1. Access the Jupyter Notebook: Open a web browser and navigate tohttp://localhost:8888/lab. You should see the Jupyter Notebook interface. Enter the token provided in the PowerShell console to access the notebook. Alternatively, you can directly click on the link that appears in the PowerShell after the container has started.

You can now use the Jupyter in the Docker container to run the python-tutorial. When you're done, you can stop the container by pressingCtrl+C in the PowerShell console.

Note

If you want to restart the container, you can simply run the commanddocker container start python_tutorial.

About

Material for a Jupyter-based Python tutorial, with Introductory, Advanced, Libraries modules

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook80.7%
  • Python19.1%
  • Other0.2%

[8]ページ先頭

©2009-2025 Movatter.jp