Template:Installing Python 3

From 6.034 Wiki

Jump to: navigation, search

Installing Python 3

There are a number of versions of Python available. 6.034 uses standard Python ("CPython") from http://www.python.org/. If you are running Python on your own computer, you should download and install Python from http://www.python.org/download/ if you do not already have it. All lab code uses Python 3.x, and we recommend using at least version 3.4, if possible.

Please note that our code will NOT work with Python 2.

On a Unix machine, you can see which version of Python 3 you have by typing the command python3 --version. Note that on Unix machines (including Athena machines), to use Python 3 you should use the command python3, as the python command defaults to Python 2.

If you are on a Windows machine and downloaded Python 3, you will probably have access to IDLE. To run a python file using IDLE, just open the file in IDLE and click Run > Run Module or hit F5 on your keyboard.

If you are using an Athena machine, you might not have access to IDLE for Python 3 (command idle3). However, you can still edit Python files in a plain-text editor, and run them like this:

python3 filename.py

Note, you can use the idle3 command with an Athena dialup connection (e.g. using SSH with the -X flag). idle3 does not yet exist on Athena workstations.

Not all versions are created equal

If you have Python version 3.5.0 or 3.5.1, you should upgrade to 3.5.2+ (or any other version of Python 3, really). There is a bug in the XMLRPC library for versions 3.5.0 and 3.5.1 which will prevent you from communicating with your server.

If you are running Mac OS X and have Python 3.5 or 3.6, you may get the following error when attempting to submit your code to the server:

ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)

This may be because your version of Python on Mac OS X is not using the system's certificate store. Assuming you have Python 3.6, executing the following may remedy this issue:

sudo /Applications/Python\ 3.6/Install\ Certificates.command

Windows users beware

If your computer is running Windows, and you are having trouble running Python from the command line or Git Bash, make sure that Python 3 is added to your PATH variable. We strongly suggest reading this page, especially sections 3.2 through 3.4.

Personal tools