Python/Interactive

From ScientificComputing
Revision as of 11:13, 23 August 2016 by Sfux (talk | contribs)

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.

[leonhard@euler06 ~]$ module load gcc/4.8.2 python/2.7.6
Autoloading openblas/0.2.13_seq
[leonhard@euler06 ~]$ 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).