Using Anaconda Python on the CiCS Managed Desktop
PLEASE NOTE: we use Anaconda Python 2.7 for teaching
purposes on CICs machines. Be warned: other
versions of Python may be installed on any CICs machine, but will
not be suitable for your classes (e.g. may not have all the required
libraries, nor provide access to the Spyder IDE). Be sure to use
only the correct version.
CiCS use an "install when first required" approach for this
software on the Managed Desktop. So, you first need to check whether
Anaconda Python is or is not already installed on the machine where
you are working.
Checking if Anaconda python is already installed ...
To check if Anaconda python is already installed on your machine:
- First, go to the START menu (i.e.
)
- In the search box enter "anac" (i.e. a prefix of anaconda)
- If this brings up an entry for "Spyder with Anaconda Python", then Anaconda is installed
(there'll also be a couple of other entries mentioning Anaconda)
- Otherwise, follow the instructions below to install Anaconda Python from CiCS
Installing Anaconda Python on your CiCS Managed Desktop machine ...
If Python is NOT already on your machine, you can install it as follows:
- First, run the Software Center application, by clicking on the desktop icon
- Select "Available Software" on the top left, to see a list of the available applications
- NOTE: It may take Software Center a few minutes to access the CiCS software list. Press F5 periodically to ask it to make a fresh attempt to access the list.
- Once the list is loaded, type python into the search box, on the top right
- if the reduced list includes "Anaconda-Python-2.7", you're right that Anaconda python is not yet installed
- Select "Anaconda-Python-2.7" in the software list and then click the "INSTALL" button, on the bottom right
- installation usually takes 2 — 5 minutes
- Once installation has finished, Anaconda Python is ready to use immediately — although it may take a minute or two to start up the first time it's used
Ways to run Anaconda Python on your CiCS machine ...
There are several ways to work with Anaconda Python on your CiCS
machine:
- Spyder Editor/IDE:
-
Enter "anac" in the START menu search box, and
launch the entry for "Spyder with Anaconda Python"
(it can take a short while to open)
-
See below for some tips on using Spyder
- IPython Notebook
-
Enter "ipy" in the START menu search box, and
launch the entry for "IP IPython (Py 2.7) Notebook"
-
IDLE — a very basic python editor/IDE (not recommended)
-
Enter "anac" in the START menu search box, and
launch the entry for "IDLE with Anaconda Python"
-
Pressing F5 runs Python on the code in the current front window
- Command Line:
-
Enter "anac" in the START menu search box, and
launch the entry for "Anaconda Command Prompt"
-
this opens a Windows CMD window, which "knows" where Anaconda Python
is
-
You can run the Python interpreter directly in the window, by entering
the command "python"
- Alternatively,
you can call Python to run your code script. First, change
the working directory to where your code is located, e.g.:
chdir /d U:/MyPythonCode
Then Python can be called to run
a code script myscript.py by entering:
python myscript.py
Some tips on using the Spyder editor/IDE:
- Use the Spyder editor to create new files
- be sure to save your code with a sensible file name, in a known folder
- e.g. create a special folder, in your University space, for your code for this course, so you can access it from any PC in the University
- You can open existing code files in Spyder, by opening the folder, and "dragging-and-dropping" the file from the folder onto Spyder
- The first time you want to run a given code file, press F6 to configure how the code is run
- select the option "Execute in a new dedicated Python interpreter"
- NOTE: for
ordinary coding, DO NOT choose the option of using the "IPython"
interpreter
- you may wish to select the option "Interact with the Python interpreter after execution"
- you can now click "Run" to execute your code
- After this first time, you can just press F5 to run the code again
Last modified Wed 23 Sep 2015 by Mark Hepple
|