Development/Python: Difference between revisions

From bwHPC Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
= Introduction =
= Introduction =
Python is a versatile, easy-to-learn, usually interpreted programming language. It offers a wide range of libraries for scientific tasks and visualization. Python is the de facto standard interface for applications of machine learning. Python can be used in particular as an open source alternative for tasks that have usually been used for Matlab.
Motivation


= Installation and Usage =
= Installation and Usage =
== Available versions ==
== Available versions ==
Python is available on all systems. Both as system Python, which comes bundled with the operating system, and via (Lmod) software modules.

<b>System Python</b> is available in different versions, typically the default system Python is too old for most users and applications. Newer versions are therefore installed alongside the standard version. You can access a specific Python version by specifying the version in the Python command. On bwUniCluster, the following versions are currently available. Please note, that these exact versions will change over time.

<source lang="bash">
$ python --version
Python 3.6.8
$ python3.8 --version
Python 3.8.16
$ python3.9 --version
Python 3.9.16
$ python3.11 --version
Python 3.11.2
$ python2 --version
Python 2.7.18
</source>


System Python
System Python


Line 9: Line 27:


== Installation ==
== Installation ==
Not required.


== Usage ==
== Usage ==

Revision as of 10:37, 5 November 2024

Introduction

Python is a versatile, easy-to-learn, usually interpreted programming language. It offers a wide range of libraries for scientific tasks and visualization. Python is the de facto standard interface for applications of machine learning. Python can be used in particular as an open source alternative for tasks that have usually been used for Matlab.

Installation and Usage

Available versions

Python is available on all systems. Both as system Python, which comes bundled with the operating system, and via (Lmod) software modules.

System Python is available in different versions, typically the default system Python is too old for most users and applications. Newer versions are therefore installed alongside the standard version. You can access a specific Python version by specifying the version in the Python command. On bwUniCluster, the following versions are currently available. Please note, that these exact versions will change over time.

$ python --version
Python 3.6.8
$ python3.8 --version
Python 3.8.16
$ python3.9 --version
Python 3.9.16
$ python3.11 --version
Python 3.11.2
$ python2 --version
Python 2.7.18


System Python

Lmod modules

Installation

Not required.

Usage

Interactively, prompt

Scripting

Via Jupyter

Package Manager

pip

Virtual Environments

Short description

Benefit

Creation

Usage

Best Practice

Always use virtual environments

Do's and don'ts


Example