This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
vm_documentation [2015/09/09 18:56] efernan |
vm_documentation [2015/09/10 13:54] efernan |
||
---|---|---|---|
Line 58: | Line 58: | ||
Alternatively, you can just restart the VM. | Alternatively, you can just restart the VM. | ||
+ | |||
+ | |||
+ | ===== Opening a Python terminal ===== | ||
+ | |||
+ | Although we'll be using the Jupyter/IPython notebook for most of our assignments, you may want to open a traditional Python terminal to test things. | ||
+ | |||
+ | Because we are using a ''virtualenv'' for the packages needed for the problem set, you can't just type ''python'' in the terminal to open a Python terminal. That will work, but you won't have access to the preinstalled python packages such as matplotlib, ipython and others. | ||
+ | |||
+ | To open a Python terminal with access to the installed packages, do the following: | ||
+ | |||
+ | - Open a terminal (double click on the LXTerminal shortcut) | ||
+ | - Enter the following in the terminal: <code>source /opt/16.410-psets/bin/activate</code> | ||
+ | - The terminal will now say ''(16.410-psets)student@defiant:~$'', indicating that the virtualenv is loaded | ||
+ | - You can now open a terminal typing ''python'', however I recommend that you use the enhanced IPython terminal, that provides TAB completion and other nice features. Type ''ipython'' to start the IPython terminal. | ||
+ | - You should be able to access all the installed packages from that terminal. Try importing the ''matplotlib'' package for example: <code python>import matplotlib</code> | ||
+ | |||
+ | |||