Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linguisticsweb:tutorials:linguistics_tutorials:python-basics [2019/09/17 18:17]
sabinebartsch
linguisticsweb:tutorials:linguistics_tutorials:python-basics [2020/04/01 20:06] (current)
sabinebartsch [Python installation]
Line 1: Line 1:
 ====== Python basics ====== ====== Python basics ======
  
-''​tutorial statusnew under construction''​+VERSION DATE2020-04-01
  
 ===== Python infrastructure ===== ===== Python infrastructure =====
  
 ==== Python installation ==== ==== Python installation ====
 +
 +Download a current version of Python 3 from https://​www.python.org/​
 +
 +{{:​linguisticsweb:​tutorials:​linguistics_tutorials:​python3-installation-01.png?​nolink&​800|}}
 +
 +
 +Make sure to select the download page for your operating system. ​
 +
 +This opens the following dialog:
 +
 +{{:​linguisticsweb:​tutorials:​linguistics_tutorials:​python3-installation-02.png?​nolink&​800|}}
 +
 +Click on the Latest Python 3 release; do not select 2.7, unless you know why you want 2.7.
 +
 +This takes you to to the following page:
 +
 +{{:​linguisticsweb:​tutorials:​linguistics_tutorials:​python3-installation-03.png?​nolink&​800|}}
 +
 +Go all the following table line with the executable installer. Most people these days will want the executable installer for 64-bit Windows:
 +
 +{{:​linguisticsweb:​tutorials:​linguistics_tutorials:​python3-installation-03_1.png?​nolink&​800|}}
 +
 +The download saves the file in your regular download directory. Under Windows for example:
 +
 +''​C:​\Users\USERNAME\Downloads''​
 +
 +Now you are ready for the installation which works like any other software installation from an executable (.exe) file. You double click on it, preferably with admin or superuser privileges which will ensure that Python is installed ​ for every user on the computer and thus to a central location on your machine rather than for just your user and your user directory. ​ The installer will guide you through the process by means of the following dialogs:
 +
 +{{:​linguisticsweb:​tutorials:​linguistics_tutorials:​python3-installation-04.png?​800|}}
 +
 +In this dialog, an option is shown for updating or customizing the installation. The update option is presented here because Python 3 is already installed on my machine. But we select the option **''​Customize installation''​** which is the same regardless of whether you are installing for the first time or upgrading:
 +
 +{{:​linguisticsweb:​tutorials:​linguistics_tutorials:​python3-installation-04_01.png?​800|}}
 +
 +In this dialog, I have left all boxes checked by default but added the update for the ''​py''​ launcher as well. This ensures that the Python launcher is installed as well. I have also selected the option to install Python for all users which ensures that Python is installed in a central location under C:\Program Files. The dialog window tells you that this option requires elevation which does not imply that you will be elevated to a higher plane of the universe (- coming to think of it, maybe that might happen as well), but that you need admin or superuser privileges on the machine. One of two things can happen here: if you have a separate administrator account on your machine and your user account has no elevated privileges, you will need to enter the administrator password in the following dialog in order to be allowed to carry on with the installation. Many people these days are working with elevated accounts all the time and will simply be asked permission to proceed with the installation. You will have to test this to see what applies on your machine. If all else fails, uncheck the option **''​for all users''​** and Python will be installed for your user only. 
 +
 +{{:​linguisticsweb:​tutorials:​linguistics_tutorials:​python3-installation-04_02.png?​800|}}
  
  
Line 40: Line 77:
 ''​py.exe -m pip install -U numpy''​ ''​py.exe -m pip install -U numpy''​
  
 +
 +The switch ''​-U''​ is equivalent to the switch ''​--update''​.
  
 === Mac OS: === === Mac OS: ===
Line 48: Line 87:
  
 Note: Mac OS users of Python 3 need to call **pip3** in order to  install Python3 modules! Note: Mac OS users of Python 3 need to call **pip3** in order to  install Python3 modules!
 +
 +The switch ''​-U''​ is equivalent to the switch ''​--update''​.
  
 ==== Python installation:​ servicing your infrastructure ==== ==== Python installation:​ servicing your infrastructure ====
  
 Every once in a while, your installed modules will have to be updated. ​ Every once in a while, your installed modules will have to be updated. ​