Skip to content

Latest commit

 

History

History
458 lines (281 loc) · 16.5 KB

InstallationGuide.md

File metadata and controls

458 lines (281 loc) · 16.5 KB

Table of Contents

  1. Video Tutorials
  2. Instructions

Installation Guide for CMPE 150

This document describes the steps for installing the necessary software for the CMPE 150 Introduction to Computing course. You will need to install the following:

  • python3
  • PyCharm
  • Teaching.Codes plugin

You can find PDF version of this document here.

Problems

If you encounter a problem during installation, first check FAQ on GitHub and Technical Support Forum on Moodle. If you can't find the solution to your problem, describe the problem with the template below and post it to Technical Support Forum.

Operating System: Specify your operating system: Windows/Linux/MacOS

Step: Specify the installation step you got the error: (e.g. Install Python, Step 5)

Error: Describe the error. Paste the error or upload a screenshot showing the error.

If the problem still continues, send an email to the mail address of your section: [email protected] for CMPE150.01 and [email protected] for CMPE150.02.

Video Tutorials

The video tutorials follow the steps described in this document with minor changes. In case of a conflict between the videos and the document, follow the instructions here.

  • The installation steps for Windows can be found on Youtube.
  • The installation steps for Linux can be found on Youtube.
  • The installation steps for MacOS can be found on Youtube.

Instructions

Step by step instructions for installing these software are provided below for the Windows, MacOS, and Linux operating systems.

1. Install Python

Windows

If Microsoft Store is supported in your computer:

  1. Go to Microsoft Store, type python 3.8 in the search bar. Download python 3.8.

  2. To control if python3.8 is installed, press the Windows button, then type:

    cmd

    and press Return (enter), thus opening the Command Prompt. Type:

    python --version

    and press Return (enter).

    If you see Python 3.8.x (3.8.6 etc.), python 3.8 has been successfully installed.

If Microsoft Store is not supported in your computer:

  1. Go to https://www.python.org/downloads/release/python-386/. Navigate to Files section.

  2. Download the installer.

    • Windows x86-64 executable installer if you're using 64 bit-Windows
    • Windows x86 executable installer if you're using 32 bit-Windows

    To check whether you're using a 32 bit or 64 bit version of Windows: Select the Start button, type Computer in the search box, right-click on Computer, and then select Properties and check System Type.

  3. Run the installer

    • Check Add Python3.8 to PATH, click Install Now and continue default installation.

Linux (Ubuntu/Debian) - If you don’t have any version of Python installed 

  1. As you are going to install Python 3.8 from the source, you need to install some development libraries to compile Python source code. Use the following commands to install prerequisites for Python.

    Open a terminal. Type:

    sudo apt-get install build-essential checkinstall

    and press Return (enter). Type your password if it asks you to and press Return (enter). Then, type:

    sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev

    and press Return (enter). If it asks you to confirm the install, type y and press Return (enter).

  2. Download Python source code using the following command from python official site. You can also download the latest version in place of specified below. Type:

    cd /opt

    and press Return (enter). Then, type:

    sudo wget https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tgz

    and press Return (enter).

  3. Extract the downloaded source archive file by typing:

    sudo tar xzf Python-3.8.6.tgz

    and pressing Return (enter).

  4. Use the below set of commands to compile Python source code on your system using the altinstall command.

    cd Python-3.8.6

    Press Return(enter).

    sudo ./configure --enable-optimizations

    Press Return(enter).

    sudo make altinstall

    Press Return(enter).

    Python 3.8.6 has successfully been installed.

  5. To check your Python version, type:

    python -V

    OR

    python3 -V

    and press Return(enter). If you see Python-3.8.6, your installation has been successful.

Linux (Ubuntu/Debian) - If you have a different version of Python than 3.8.6 installed, and actively use it

  1. Open a terminal. First, update your package list by typing:

    sudo apt-get update

    and press Return (enter). Type your password if it asks you to and press Return (enter). Then, upgrade your packages with:

    sudo apt-get upgrade

    and press Return(enter). Type your password if it asks you to and press Return(enter). If it asks you to confirm the install, type y and press Return(enter).

  2. If you do not have curl and/or git, you need to install them by typing:

    sudo apt install curl

    Type your password if it asks you to and press Return(enter) to install curl. If it asks you to confirm the install, type y and press Return(enter).

    For git type:

    sudo apt install git

    Type your password if it asks you to and press Return(enter) to install git. If it asks you to confirm the install, type y and press Return(enter).

  3. Install some important packages like the build-essential package:

    sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

    Type your password if it asks you to and press Return(enter). If it asks you to confirm the install, type y and press Return(enter).

  4. Next, type the following line, then press Return(enter).

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

    Type your password if it asks you to and press Return(enter). Then press Return(enter) when it asks you to continue the installation. Wait for the installation to finish. Then type the following line, then press Return(enter).

    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"'>> ~/.bashrc

    Be careful if you are copying from the document, the characters may not exactly be the same (like the single quote) and cause errors.

    This may complete without issue, (in which case move on to the next step) or give you a permission denied error. If you get this error, go to your home directory, press Ctrl + H to see the hidden files in your system. Open the .bashrc file with a text editor and add a new line at the end of the file, and write the following line there:

    eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)

    DO NOT CHANGE ANYTHING ELSE ON THE FILE. Save the file and close it.

    Close the terminal.

  5. Open a new terminal and type:

    brew help

    and press Return(enter). If everything went well, a bunch of text will appear about how you can use brew. Then, type:

    brew update

    then press Return(enter). After the update finishes, type:

    brew install pyenv

    then press Return(enter). After the installation finishes, type the following line, then press Return(enter).

    echo 'eval "$(pyenv init -)"' >> ~/.bash_profile

    Be careful if you are copying from the document, the characters may not exactly be the same (like the single quote) and cause errors. Close the terminal.

  6. Open a new terminal and type:

    pyenv install 3.8.6

    then press Return(enter).

    This will install Python 3.8.6 to your computer. After the installation finishes, type:

    pyenv global 3.8.6

    then press Return(enter). This will set python 3.8 as the default python in your computer. Check this by typing:

    python -V

    OR

    python3 -V

    then press Return(enter). If it says python 3.8, installation is complete.

MacOS

  1. Open your terminal. Type the following line, then press Return(enter).

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

    Type your password if it asks you to and press Return(enter). Then press Return(enter) when it asks you to continue the installation.

  2. After the installation is complete, check if it is completed successfully by typing

    brew help

    in the terminal and pressing Return(enter).

    If it is completed successfully, a bunch of text will appear about how you can use brew. Then, type:

    brew update

    then press Return(enter). After the update finishes, type:

    brew install pyenv

    then press Return(enter). After the installation finishes, type:

    echo 'eval "$(pyenv init -)"' >> ~/.bash_profile

    then press Return(enter).

    Be careful if you are copying from the document, the characters may not be exactly the same (like the single quote) and this may cause errors that you can not notice. We suggest you type the single quotation marks yourselves by using the keyboard.

    This may complete without issue, (in which case move on to the next step) or give you a permission denied error. If you get this error, go to your home directory, press Command+Shift+Dot to see hidden files (You can press them again to hide later.) Open the .bash_profile file with a text editor and try to add a new empty line at the end of the file. It may not allow you to, if so, change the permissions of the file to read&write and write to a new line at the bottom of the file the following:

    eval "$(pyenv init -)"

    DO NOT CHANGE ANYTHING ELSE ON THE FILE. Save the file and close it. Close the terminal.

  3. Open a new terminal and type:

    pyenv install 3.8.6

    then press Return(enter). This will install Python 3.8.6 to your computer. After the installation finishes, type:

    pyenv global 3.8.6

    then press Return(enter). This will set python 3.8.6 as the default python in your computer. Check this by typing:

    python -V

    OR

    python3 -V

    then press Return(enter). If it says python 3.8.6, installation is complete.

2. Install PyCharm

Windows & MacOS

Go to https://www.jetbrains.com/pycharm/

In the Download page, choose your operating system (Windows, Mac or Linux) and download from the “Community” option.

After the download finishes, install PyCharm. Your computer may not trust applications downloaded from the web, if so change this from your system preferences or trust this source in the appearing dialog.

The installation will begin, accept the license agreement and choose your settings like the dark theme, create a launcher script if you wish (you don’t need to), and you will not need any plugins it shows you.

After the installation, run PyCharm.

Make sure your PyCharm version is 2020.3.X or above. If you have a previous version, you must update it or install new version.

Linux (Ubuntu/Debian)

Go to Ubuntu Software, type PyCharm Pro. Install PyCharm Pro.

The installation will begin, accept the license agreement and choose your settings like the dark theme, create a launcher script if you wish (you don’t need to), and you will not need any plugins it shows you.

License Activation window will appear next. Enter your license information that has been sent to you and activate your license.

Welcome to PyCharm window should appear.

Make sure your PyCharm version is 2020.3.X or above. If you have a previous version, you must update it or install new version.

3. Create a new project

Click on the New Project button. From the window that comes up, choose Pure Python from the left side.

In the options on the right side, you can write a project name of your choosing at the end of the Location setting -the one at the top of the window- by deleting the pythonProject and writing something like myFirstProject or hello.

Then, under Python Interpreter, make sure the New environment using Virtualenv is checked, and make sure the Base interpreter is pointing to the location of the python you just downloaded. Windows will usually find this by itself. In Linux and Mac, this may point to the default python which comes pre-installed in your computer; so click the three dots and navigate to your home directory, and find among the hidden files the folder .pyenv and among the files in that directory choose python3.8.

The location should be something similar to what is below:

/home/myusername/.pyenv/versions/3.8.6/bin/python3.8

where instead of myusername you will see your own username.

For Linux, if you haven’t installed pyenv during your python installation (if you followed the first set of instructions for your Python installation, which indicates “If you don’t have any version of Python installed” ), you can find the location of your python directory, by typing in the Terminal:

which python

OR

which python3

This will tell you the location of your Python 3.8.6 directory. Your Base Interpreter should point to this location.

Check the Create a main.py welcome script for this time and click Create. It will take a little while and your project will be created. If you see no errors, everything is in order.

1616342184949

At the top right of your screen, you will see the section in the image above. Click the Run button (big green triangle) and at the bottom of the screen a Run window will appear, and it will have the writing:

Hi, PyCharm

4. Install the Teaching Codes Plugin

Go to the link for your operating system and download the zip file:

Windows: https://programming.cmpe.boun.edu.tr/downloads/StudentPlugin/TCPluginJetBrains_Windows.zip

Linux: https://programming.cmpe.boun.edu.tr/downloads/StudentPlugin/TCPluginJetBrains_Linux.zip

MacOS: https://programming.cmpe.boun.edu.tr/downloads/StudentPlugin/TCPluginJetBrains_MacOs.zip

While PyCharm is open, go to File>Settings (just Preferences in Mac) and find Plugins on the left.

Click the gear icon on the top (shown in red circle in the image below) and click Install Plugin from Disk…

1616341138563

Navigate to the location of the zip file and choose it. Click OK.

It will ask to restart PyCharm to apply changes in plugins. Click Restart.

After it restarts, you should see at the bottom right Teaching Codes. Click on it and you should see the login screen. You can login with the information that has been sent to you.

1616342517499