Introduction
The first step before you learn any software is to install it in your computer. if you have it in your computer then you can use it to learn. learn some basics about software installation so that you can troubleshoot it in later stages. before you install go through the following sections to know the versions, options and then install the latest version. nowadays you can use online version of software to start learning and later you can install at your ease.
Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python’s simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse. The Python interpreter and the extensive standard library are available in source or binary form without charge for all major platforms and can be freely distributed.
Python is a great general-purpose programming language on its own, but with the help of a few popular libraries (numpy, scipy, matplotlib) it becomes a powerful environment for scientific computing. Basic information regarding the versions is given here starting from version 2, you can choose one or two level below the latest versions for your learning.
Python Version
Python 2
Published in late 2000, Python 2 signaled a more transparent and inclusive language development process than earlier versions of Python with the implementation of PEP (Python Enhancement Proposal), a technical specification that either provides information to Python community members or describes a new feature of the language.
Additionally, Python 2 included many more programmatic features including a cycle-detecting garbage collector to automate memory management, increased Unicode support to standardize characters, and list comprehensions to create a list based on existing lists. As Python 2 continued to develop, more features were added, including unifying Python’s types and classes into one hierarchy in Python version 2.2.
Python 3
Python 3 is regarded as the future of Python and is the version of the language that is currently in development. A major overhaul, Python 3 was released in late 2008 to address and amend intrinsic design flaws of previous versions of the language. The focus of Python 3 development was to clean up the codebase and remove redundancy, making it clear that there was only one way to perform a given task.
Major modifications to Python 3.0 included changing the print statement into a built-in function, improve the way integers are divided, and providing more Unicode support.
At first, Python 3 was slowly adopted due to the language not being backwards compatible with Python 2, requiring people to make a decision as to which version of the language to use. Additionally, many package libraries were only available for Python 2, but as the development team behind Python 3 has reiterated that there is an end of life for Python 2 support, more libraries have been ported to Python 3. The increased adoption of Python 3 can be shown by the number of Python packages that now provide Python 3 support, which at the time of writing includes 339 of the 360 most popular Python packages.
Python 2.7
Following the 2008 release of Python 3.0, Python 2.7 was published on July 3, 2010 and planned as the last of the 2.x releases. The intention behind Python 2.7 was to make it easier for Python 2.x users to port features over to Python 3 by providing some measure of compatibility between the two. This compatibility support included enhanced modules for version 2.7 like unittest to support test automation, argparse for parsing command-line options, and more convenient classes in collections.
Because of Python 2.7’s unique position as a version in between the earlier iterations of Python 2 and Python 3.0, it has persisted as a very popular choice for programmers due to its compatibility with many robust libraries. When we talk about Python 2 today, we are typically referring to the Python 2.7 release as that is the most frequently used version.
Python 2.7, however, is considered to be a legacy language and its continued development, which today mostly consists of bug fixes, will cease completely in 2020.
Key Differences
While Python 2.7 and Python 3 share many similar capabilities, they should not be thought of as entirely interchangeable. Though you can write good code and useful programs in either version, it is worth understanding that there will be some considerable differences in code syntax and handling.
you can download python by visiting the website :https://www.python.org/downloads/
you will need to install required libraries after installing the python else you can go for Anaconda with is a package with python and all the latest libraries in it. you need to just install anaconda and rest will be taken care.
Active Python Releases
These are the latest versions of python. Note that Python 3.9+ cannot be used on Windows 7 or earlier.
Alternative Python Implementations
This site hosts the “traditional” implementation of Python (nicknamed CPython). A number of alternative implementations are available as well, namely
- IronPython (Python running on .NET)
- Jython (Python running on the Java Virtual Machine)
- PyPy (A fast python implementation with a JIT compiler)
- Stackless Python (Branch of CPython supporting microthreads)
- MicroPython (Python running on micro controllers)
Anaconda Python Distribution
Anaconda is an open-source package manager, environment manager, and distribution of the Python and R programming languages. It is commonly used for large-scale data processing, scientific computing, and predictive analytics, serving data scientists, developers, business analysts, and those working in DevOps.
Anaconda offers a collection of over 720 open-source packages, and is available in both free and paid versions. The Anaconda distribution ships with the conda command-line utility. You can learn more about Anaconda and conda by reading the Anaconda Documentation pages.
Why Anaconda?
- User level install of the version of python you want
- Able to install/update packages completely independent of system libraries or admin privileges
- conda tool installs binary packages, rather than requiring compile resources like pip – again, handy if you have limited privileges for installing necessary libraries.
- More or less eliminates the headaches of trying to figure out which version/release of package X is compatible with which version/release of package Y, both of which are required for the install of package Z
- Comes either in full-meal-deal version, with numpy, scipy, PyQt, spyder IDE, etc. or in minimal / alacarte version (miniconda) where you can install what you want, when you need it
- No risk of messing up required system libraries
Installing on Windows
- Download the Anaconda installer.
- Optional: Verify data integrity with MD5 or SHA-256. More info on hashes
- Double click the installer to launch.
NOTE: If you encounter any issues during installation, temporarily disable your anti-virus software during install, then re-enable it after the installation concludes. If you have installed for all users, uninstall Anaconda and re-install it for your user only and try again.
- Click Next.
- Read the licensing terms and click I Agree.
- Select an install for “Just Me” unless you’re installing for all users (which requires Windows Administrator privileges).
- Select a destination folder to install Anaconda and click Next.
NOTE: Install Anaconda to a directory path that does not contain spaces or unicode characters.
NOTE: Do not install as Administrator unless admin privileges are required.
- Choose whether to add Anaconda to your PATH environment variable. We recommend not adding Anaconda to the PATH environment variable, since this can interfere with other software. Instead, use Anaconda software by opening Anaconda Navigator or the Anaconda Command Prompt from the Start Menu.
- Choose whether to register Anaconda as your default Python 3.6. Unless you plan on installing and running multiple versions of Anaconda, or multiple versions of Python, you should accept the default and leave this box checked.
- Click Install. You can click Show Details if you want to see all the packages Anaconda is installing.
- Click Next.
- After a successful installation you will see the “Thanks for installing Anaconda” image:
- You can leave the boxes checked “Learn more about Anaconda Cloud” and “Learn more about Anaconda Support” if you wish to read more about this cloud package management service and Anaconda support. Click Finish.
- After your install is complete, verify it by opening Anaconda Navigator, a program that is included with Anaconda. From your Windows Start menu, select the shortcut Anaconda Navigator. If Navigator opens, you have successfully installed Anaconda.
Installing on macOS
- Download the graphical macOS installer for your version of Python.
- OPTIONAL: Verify data integrity with MD5 or SHA-256. For more information on hashes, see What about cryptographic hash verification?.
- Double-click the .pkg file.
- Answer the prompts on the Introduction, Read Me and License screens.
- On the Destination Select screen, select Install for me only.
NOTE: If you get the error message “You cannot install Anaconda in this location,” reselect Install for me only.
- On the Installation Type screen, you may choose to install in another location. The standard install puts Anaconda in your home user directory:
- Click the Install button.
- A successful installation displays the following screen:
Installing on Linux
- In your browser, download the Anaconda installer for Linux.
- Optional: Verify data integrity with MD5 or SHA-256. (For more information on hashes, see cryptographic hash validation.)
Run the following:
md5sum /path/filename OR:
sha256sum /path/filename
- Verify results against the proper hash page to make sure the hashes match.
- Enter the following to install Anaconda for Python 3.6:
bash ~/Downloads/Anaconda3-4.4.0-Linux-x86_64.sh OR
Enter the following to install Anaconda for Python 2.7:
bash ~/Downloads/Anaconda2-4.4.0-Linux-x86_64.sh NOTE: You should include the bash command regardless of whether you are using Bash shell.
NOTE: Replace actual download path and filename as necessary.
NOTE: Install Anaconda as a user unless root privileges are required.
- The installer prompts “In order to continue the installation process, please review the license agreement.” Click Enter to view license terms.
- Scroll to the bottom of the license terms and enter yes to agree to them.
- The installer prompts you to click Enter to accept the default install location, press CTRL-C to cancel the installation, or specify an alternate installation directory. If you accept the default install location, the installer displays ‘PREFIX=/home/”user”/anaconda”2 or 3″‘ and continues the installation. It may take a few minutes to complete.
The installer prompts “Do you wish the installer to prepend the Anaconda”2 or 3″ install location to PATH in your /home/”user”/.bashrc ?” We recommend yes.
NOTE: If you enter “no”, you will need to manually specify the path to Anaconda when using Anaconda. To manually add the prepended path, edit file .bashrc to add ~/anaconda”2 or 3″/bin to your path manually using:
- export PATH=”/home/”user”/anaconda”2 or 3″/bin:$PATH”
Replace /home/”user”/anaconda”2 or 3″ with the actual path.
- The installer finishes and displays “Thank you for installing Anaconda”2 or 3″!”
- Close and open your terminal window for the installation to take effect, or you can enter the command source ~/.bashrc.
Enter conda list. If the installation was successful, the terminal window should display a list of installed Anaconda packages.
NOTE: Power8 users: Navigate to your Anaconda directory and run this command:
conda install libgfortran
What are Jupyter notebook?
The notebook is a web application that allows you to combine explanatory text, math equations, code, and visualizations all in one easily sharable document.
Notebooks have quickly become an essential tool when working with data. You’ll find them being used for data cleaning and exploration, visualization, machine learning, and big data analysis. Typically you’d be doing this work in a terminal, either the normal Python shell or with IPython. Your visualizations would be in separate windows, any documentation would be in separate documents, along with various scripts for functions and classes. However, with notebooks, all of these are in one place and easily read together.
Notebooks are also rendered automatically on GitHub. It’s a great feature that lets you easily share your work. There is also http://nbviewer.jupyter.org/ that renders the notebooks from your GitHub repo or from notebooks stored elsewhere.
How notebook works?
Jupyter notebooks grew out of the IPython project started by Fernando Perez. IPython is an interactive shell, similar to the normal Python shell but with great features like syntax highlighting and code completion. Originally, notebooks worked by sending messages from the web app (the notebook you see in the browser) to an IPython kernel (an IPython application running in the background). The kernel executed the code, then sent it back to the notebook. The current architecture is similar, drawn out below.
The central point is the notebook server. You connect to the server through your browser and the notebook is rendered as a web app. Code you write in the web app is sent through the server to the kernel. The kernel runs the code and sends it back to the server, then any output is rendered back in the browser. When you save the notebook, it is written to the server as a JSON file with a .ipynb file extension.
The great part of this architecture is that the kernel doesn’t need to run Python. Since the notebook and the kernel are separate, code in any language can be sent between them. For example, two of the earlier non-Python kernels were for the R and Julia languages. With an R kernel, code written in R will be sent to the R kernel where it is executed, exactly the same as Python code running on a Python kernel. IPython notebooks were renamed because notebooks became language agnostic. The new name Jupyter comes from the combination of Julia, Python, and R. If you’re interested, here’s a list of available kernels.
Another benefit is that the server can be run anywhere and accessed via the internet. Typically you’ll be running the server on your own machine where all your data and notebook files are stored. But, you could also set up a server on a remote machine or cloud instance like Amazon’s EC2. Then, you can access the notebooks in your browser from anywhere in the world.
Installing Jupyter Notebook
By far the easiest way to install Jupyter is with Anaconda. Jupyter notebooks automatically come with the distribution. You’ll be able to use notebooks from the default environment.
To install Jupyter notebooks in a conda environment, use conda install jupyter notebook.
Jupyter notebooks are also available through pip with pip install jupyter notebook.
Launching the notebook server
To start a notebook server, enter jupyter notebook in your terminal or console. This will start the server in the directory you ran the command in. That means any notebook files will be saved in that directory. Typically you’d want to start the server in the directory where your notebooks live. However, you can navigate through your file system to where the notebooks are.
When you run the command (try it yourself!), the server home should open in your browser. By default, the notebook server runs at http://localhost:8888. If you aren’t familiar with this, localhost means your computer and 8888 is the port the server is communicating on. As long as the server is still running, you can always come back to it by going to http://localhost:8888 in your browser.
If you start another server, it’ll try to use port 8888, but since it is occupied, the new server will run on port 8889. Then, you’d connect to it at http://localhost:8889. Every additional notebook server will increment the port number like this.
There is also other option to install python, which is called miniconda , this is similar to anaconda but with minimum libraries in it. later we can install the required libraries with PIP command. with this method we come to know different libraries and space int the disk will be saved.
————————————————————————————————————-
You can find the above information in the Jupyter Notebook version as shown;