Python/Interactive

From ScientificComputing
Revision as of 07:20, 21 October 2022 by Sfux (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

In order to start an interactive Python session on one of the login nodes, you can use the command python to start the Python interpreter.

[sfux@eu-login-06 ~]$ module load gcc/4.8.2 python/2.7.6
Autoloading openblas/0.2.13_seq
[sfux@eu-login-06 ~]$ python
Python 2.7.6 (default, Jan 20 2014, 14:02:29) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import a_module_that_is_not_installed_yet
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named a_module_that_is_not_installed_yet
>>>

Interactive sessions can be used to check if a particular package is already installed or not (if a package is not installed yet, the import statement will result in an error message).