Programming Environment Setup


Select Your Operating System

Ubuntu Linux

Launch a terminal and run the following commands:

Change to your home folder.

$ cd $HOME

Install python3-pip and python3-tk.

$ sudo apt-get install python3-pip python3-tk

Install numpy and pygame.

$ pip3 install numpy pygame

Create lib and workspace folders.

$ mkdir lib workspace

Download stdlib-python.zip.

$ wget https://www.cs.umb.edu/~siyer/teaching/stdlib-python.zip

Unzip stdlib-python.zip under ~/lib.

$ unzip stdlib-python.zip -d lib

Remove stdlib-python.zip.

$ rm stdlib-python.zip

Set the environment variable PYTHONPATH.

$ echo "export PYTHONPATH=.:$HOME/lib/stdlib-python" >> $HOME/.bashrc

Download and install PyCharm (Community Edition).

To test your environment, download and unzip ipp.zip under ~/workspace, launch PyCharm, open the project ~/workspace/ipp, and run the following commands in the PyCharm terminal:

$ python3 helloworld.py 
$ python3 bouncingball.py 
$ python3 playthattune.py < data/looney.txt 

To add a Python interpreter to a project in PyCharm, open the project, go to File > Settings > Project: <project name> > Python Interpreter, and from the pull-down menu on the right select Python 3.x that is installed in the system.

Mac OS X

Launch a terminal and run the following commands:

Change to your home folder.

$ cd $HOME

Install brew.

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install python-tk and wget.

$ brew install python-tk wget

Install numpy and pygame.

$ pip3 install numpy pygame

Create lib and workspace folders.

$ mkdir lib workspace

Download stdlib-python.zip.

$ wget https://www.cs.umb.edu/~siyer/teaching/stdlib-python.zip

Unzip stdlib-python.zip under ~/lib.

$ unzip stdlib-python.zip -d lib

Remove stdlib-python.zip.

$ rm stdlib-python.zip

Set the environment variable PYTHONPATH.

$ echo "export PYTHONPATH=.:$HOME/lib/stdlib-python" >> $HOME/.zshenv

Download and install PyCharm (Community Edition).

To test your environment, download and unzip ipp.zip under ~/workspace, launch PyCharm, open the project ~/workspace/ipp, and run the following commands in the PyCharm terminal:

$ python3 helloworld.py 
$ python3 bouncingball.py 
$ python3 playthattune.py < data/looney.txt 

To add a Python interpreter to a project in PyCharm, open the project, go to File > Settings > Project: <project name> > Python Interpreter, and from the pull-down menu on the right select Python 3.x that is installed in the system.

Windows

Install Python 3, making sure you have checked the box that says Add Python 3.x to PATH.

Launch a powershell terminal and run the following commands:

Change to your home folder.

$ cd $HOME

Install numpy and pygame.

$ pip3 install numpy pygame

Create lib and workspace folders.

$ mkdir lib,workspace

Download stdlib-python.zip.

$ wget -O stdlib-python.zip https://www.cs.umb.edu/~siyer/teaching/stdlib-python.zip

Unzip stdlib-python.zip under ~/lib.

$ Expand-Archive -LiteralPath stdlib-python.zip -DestinationPath lib

Remove stdlib-python.zip.

$ rm stdlib-python.zip

Set the environment variable PYTHONPATH.

$ setx PYTHONPATH ".;$HOME\lib\stdlib-python"

Download and install PyCharm (Community Edition).

To test your environment, download and unzip ipp.zip under ~/workspace, launch PyCharm, open the project ~/workspace/ipp, and run the following commands in the PyCharm terminal:

$ python.exe helloworld.py 
$ python.exe bouncingball.py 
$ Get-Content data/looney.txt | python.exe playthattune.py

To add a Python interpreter to a project in PyCharm, open the project, go to File > Settings > Project: <project name> > Python Interpreter, and from the pull-down menu on the right select Python 3.x that is installed in the system.