Alternate IDEs/Installations (not recommended)
Below are some alternate IDEs/installations. We provide some minimal notes on how you can get these working here but note that lecturers and tutors are not in general able to provide technical support for any of these. We recommend you just use the Anaconda distribution and its included Spyder IDE.
PyCharm#
The PyCharm IDE is available for download (not installed on CSIT environment). Like Spyder, it provides a split-window layout, with an editor, a python shell, and other tools. Note that PyCharm does not open a python shell on start-up, but only when you run a program. Before you can run a program in PyCharm, you will need to set the python interpreter. Click on the “Configure Python Interpreter” link:
and select (or type in if it’s not available as a choice)
/usr/local/anaconda3/bin/python3
.
The IDE that is used in the lectures is Spyder or PyCharm.
Installing core Python#
Instead of Anaconda Spyder, you can also install the core Python implementation, available from python.org. We do not recommend this as your first option, however. Why you ask?
- The core installation does not provide all packages that we will be using, since… well it is the core distribution.
- Thus, you will be required to (painfully) install these packages by yourself, one at a time.
- The core python distribution comes with the IDLE IDE, which is (by many) considered inferior to other IDEs, such as Spyder.
If you are still keen to it take on, the most important modules which constitute the scientific Python core are:
numpy
defines the fundamental data structures (so called ndarrays, N-dimensional arrays), fast mathematical operations on these arrays, and other routines which are used in numerical computations (linear algebra and matrix operations, Fourier transform, random number generators etc).scipy
defines scientific computing routines (essentially, it is a Python port of classic routines, like Linpack, which were first developed for use with the Fortran programming language and are now regarded as a gold standard of numerical software);scipy
fundamentally relies onnumpy
for the representation of core data structures (arrays).matplotlib
is a 2D (and some 3D) plotting (and some animation) library; it has a packagepyplot
which simplifies its usage.ipython/jupyter
is a advanced shell (command-line environment) for quick Python development, which can be executed in a stand-alone shell, like QtConsole, or run from within the Terminal system shell window. IPython/Jupyter can also be run in a browser, so called IPython/Jupyter notebooks; in which you can type in and execute code (Python statements), but also insert text and media (images, movies, audio). Latest notebooks can also incorporate programmable element called widgets, which provide an enhanced control over code execution (these widgets emulate features available in a commercial system Mathematica). IPython notebooks are often used as a format for presentation of research work, lecture course materials and even textbooks and monographs. Visit the web site A gallery of interesting IPython Notebooks, to see the tremendous ranges of available resources. An IPython notebook is stored in a file with.ipynb
suffix; it can be open in a web browser (you need to launch the IPythone/Jupyter kernel first).sympy
is the package for symbolic computation (and also high-precision mathematics); it emulates the functionality of commercial products like Mathematica and Maple (and the open source Sage).pandas
provides high-performance, easy-to-use data structures and data analysis tools.scikit-image
,scikit-learn
andstatsmodels
are three most widely used packages from a large set of Scikits, a collection of add-on packages for SciPy (they are hosted and developed separately from the main SciPy distribution).
You can install each of them in addition to your standard Python
distribution by running the pip3
command on the command-line interface:
% pip3 install pkgname
To install a package on the system globally (for other users), it needs to be run with the administrator privileges:
% sudo pip3 install pkgname
Alternatively (to avoid unnecessary duplication of Python
installations), you can start with installing Miniconda (like its
“big cousin” Anaconda, it is available for all major OS platforms.
The Miniconda distro contains only the standard Python
plus the Conda manager). Once installed,
conda
tool can be used to install packages which you
need: eg:
% conda install numpy
IDLE#
IDLE is the default IDE for python, and comes with most python distributions. It is more simplistic (some would say it is just bad), but some students may find it sufficient. You can find “Idle3 Anaconda” on the CSIT computers. On the InfoCommons Windows or Mac computers, you will have to use the search function on the start menu and search for “IDLE” or “python IDLE”. There is more than one version available, so check after you have started it that you have the right one (it should show a message like the one above). In particular, make sure it is running python 3.
IDLE has a separate window for the python shell, and one window for each file you edit. To run a program in IDLE, you can select “Run Module” from the menu in the editor window, or press F5.
Text Editors#
If you are not using the Spyder IDE (that comes with Anaconda), you should install and learn to use use some modern programming editor, for example:
- Atom is available for every major platform
- Sublime Text 3 is also multi-platform
- TextMate 2 is an excellent Mac programming editor