Installing Python 3 on Windows
In this section, we want to discuss how to install Python on Windows. This might even apply to other platforms as well, although there is a separate tutorial for doing Linux installations. If you want to be able to install Python, you go visit the web site in your web browser: https://www.python.org/downloads/. And from here, you can download the latest version of either Python 3, which you probably should, or Python 2, which you also could. You also can find specific releases of Python, so if you’re looking for something that isn’t precisely the current release, you could get something a little bit older as well. You could also find the source code here for Python, as well as links to documentation, community web sites, success stories, news on Python, as well as Python events.
The browser window is open to the Python web site. The navigation bar along the top of the page has seven tabs: About, Downloads, Documentation, Community, Success Stories, News, and Events. Downloads is selected. The Download page lists the latest version of Python for Windows with two buttons: Download Python 3.5.1 and Download Python 2.7.11. Below the buttons is a section titled Looking for a specific release? It contains table of previous Python releases by version. The table lists the release version, release date, a download link, and link to the release notes for each version. The drop-down menu includes links to Docs, Audio/Visual Talks, Beginners Guide, and Developers Guide.
After downloading, If you double-click on that file, it’ll begin the Installer. And depending on what privileges you have, the first choice you need to make is whether to install Python for all users, which is the default, or to only install for just you. If you install for all users, you’ll have to have full system administrator privileges on the system, and it could potentially impact other people who share the computer. If you choose to install just for me, then it will only impact your account. You’ll need to have at least administration capabilities over the files for your account.
One of the benefits of installing just for me, is that you could have other users that have different versions of Python set up for them. So we would recommend this choice, unless there’s a need to make it available for everyone, and you don’t want to have to log in as each person to set it up for them. So then you go on to your next step, and you can choose a drive and directory. Typically the default directory that is used, which will be C:\Python, whatever version number, backslash, and then underneath it you’ll find other directories.
Most of the things for Python will automatically be set up for you. You can save having to go to the System Control Panel in order to add the Python directory to your Python path, if you choose to install this feature. Otherwise you will have to edit the environment variables, in your System Control Panel, in order to make sure that that is set correctly. Next you’ll need to have that authority to allow this installation to continue on your system. If you have that, you should click Yes, and, after a few minutes, the files will all be installed.
The Install Python 3.4.3 screen is displayed and shows the progress of the installation. A terminal window titled C:\Python34\python.exe opens showing the output of the installation commands being executed. The window closes.
Installing Python 3 on Linux
In this section, we’re going to be discussing how to install Python 3 in the Linux environment. Fortunately, for most users, Python 3 will already be installed by default, so if you were to type python3, you would end up in a Python 3 interpreter. Pressing Ctrl+D will exit the Python shell. Also Python 2 is typically installed by default. Again, pressing Ctrl+D will exit the Python shell.
The most recent versions of Linux are now to the point where they’re about ready to eliminate using Python 2 at all. There’s very few things that depend on Python 2, and Korora, and Fedora, and other distributions like them are moving forward and in the near future will not have Python 2 installed by default. What’s interesting to note, is as far forward as they have moved towards Python 3, still by default, if you just type in python, typically it will take you to the Python interpreter. If you
look at the way this is managed, you could use the which command to find out which file you execute when you type the python command, and so we see that /usr/bin/python. Using ls –l, you can list the details of that file.
Since the file starts with an l in its attributes, and security permissions, it indicates that it is a link where /usr/bin/python is linked to Python 2. While you could change this link. As an administrator you can do, pretty much, what you’d like. Upon updating Python, you would find that the link would have been updated back to the original link location. So this is probably not the best choice as a future update will break this from happening. A better solution, is to possibly create
your own link in a directory that’s listed in the path prior to the usr/bin path, or /usr/bin path. In this case, the /usr/local/bin path is listed first, so, if you create a link in that directory, it will be found before the one listed here in the middle.
To create a link like that, you can type the ln -s command to link /usr/bin/python3 /usr/local/bin/python. So this will create the filename listed here, on the right, linking it to this filename listed here, on the left, with a softer symbolic link. To make sure you clear your hash, cache, of any paths like typing python, you can type hash –r. You may not have to do this, especially if you log out and log back in again. But now, with this link in place, if you type in python, it correctly takes me
to the Python 3 Interpreter.
Now you face a similar problem with IDLE. IDLE is the Integrated Development Environment that accompanies Python. IDLE, although not found on this system, will have it recommend that you install python-tools to provide IDLE. So while you could say yes to do this, this will only provide the Python version 2 IDLE environment. So yo are going to use no as the answer, and instead you can either use yum or DNF to install python3-tools.