Some Basic Concepts.pptx
Document Details
Uploaded by AstoundedSeries911
Emory University
Full Transcript
Some Basic Concepts Prof. George S. Easton (c) 2024, George S. Easton Concepts Open Source Software Virtual Environments Package Manager (c) 2024, George S. Easton Open Source Software Python and Anaconda Python are open-source software. So, what is open-sou...
Some Basic Concepts Prof. George S. Easton (c) 2024, George S. Easton Concepts Open Source Software Virtual Environments Package Manager (c) 2024, George S. Easton Open Source Software Python and Anaconda Python are open-source software. So, what is open-source software? From Wikipedia: “Open-source software (OSS) is computer software that is released under a license in which the copyright holder grants users the rights to use, study, change, and distribute the software and its source code to anyone and for any purpose.” OSS is usually developed in a collaborative fashion with many participants developing features, functionality, and packages. (c) 2024, George S. Easton Characteristics of OSS Positives You can examine the source. It’s free. It is generally developed by “volunteers.” (Well, sort of.) If it is popular, many people will be contributing functionality. So, there will be many “packages” of contributed software which means that there is a great deal of widely varying functionality. For popular open-source software, the quality of the software is often very high. (c) 2024, George S. Easton Characteristics of OSS (cont.) Issues/Problems/Negatives There can be multiple versions of the core software. Large numbers of packages creates a package management issue: Finding and installing packages. Packages interfering with each other. Dependency, compatibility, version and revision control. Many packages are built on top of other packages. (c) 2024, George S. Easton Characteristics of OSS (cont.) Issues/Problems/Negatives (cont.) Multiple packages have the same functionality. Which package is best? Quality of the software varies and is never guaranteed. Quality of documentation varies. Support is provided by “the community” and can range from excellent to incorrect or non-existent. User interfaces are often primitive (i.e., command line). (c) 2024, George S. Easton Python Is Open Source Anaconda Python is open source as well. Python is a very good computer language. Python is an interpreted language which speeds development but slows execution speed. Python is very popular. The core parts of Python are very high quality and well supported. (c) 2024, George S. Easton Python Is Open Source (cont.) There are a vast number of packages for Python implementing an incredible array of functionality. You can do almost anything with Python. But, Python benefits and suffers from all the characteristics of open-source software. (c) 2024, George S. Easton Comment There is much more that can be said about open-source software. For example, I have said nothing about the types of software licenses used for open- source software. I am limiting what I am discussing now to what I think is important in order to understand how I will set up Anaconda Python. (c) 2024, George S. Easton Virtual Environments A virtual environment can be thought of as a container that isolates the Python interpreter, libraries, software scripts, and packages from interference from software outside of the environment. A virtual environment is generally customized to a project or group of similar projects. Only packages and other software needed for the project are loaded into the environment. (c) 2024, George S. Easton Virtual Environments (cont.) A virtual environment prevents scripts and packages from other environments (projects) from interfering with any packages or scripts in the current environment. Different environments can have different versions of the same packages and also different versions of Python. In Python there is an environment manager for creating and managing environments. (c) 2024, George S. Easton Isolation and Encapsulation In computing and programming, isolation and encapsulation refer to the idea of creating a boundary around software that prevents other software from interfering with it or changing its data (in a damaging way). (c) 2024, George S. Easton Isolation and Encapsulation (cont.) Isolation and encapsulation can occur at a very high level or within a single program or script: High Level: Creating a virtual computer to run an application. (Like and AWS instance.) Low Level: Making data in a data structure private within a script to that other parts of the script can’t accidentally change it. Python virtual environments operate at an intermediate level. (c) 2024, George S. Easton Isolation and Encapsulation (cont.) The term “container” is often used to refer to something that implements isolation and/or encapsulation. So a Python environment is a type of container. The idea of containers and isolation can also be used to ensure that applications run in the same way on different computing environments (i.e., operating systems, (c) 2024, George S. Easton Package Manager In Python, almost all functionality is created via packages. Basic Python contains very little functionality on its own. The package manager is used to find and download packages from internet archives. (c) 2024, George S. Easton Package Manager (cont.) The package manager also checks for certain kinds of dependency. If a package about to be installed, requires other packages, they will be installed as well. If a package requires an earlier version of a previously installed packaged, the package manager will revert the previously installed packaged to the required earlier version. This can get complicated. (c) 2024, George S. Easton Python Utilities In traditional Python: The package manager is call pip. The environment manager is called virtualenv. In Anaconda Python, one utility does both package management and environment management: It is called conda. (c) 2024, George S. Easton Summary Open-source software Isolation and encapsulation Environments Packages and package management pip virtualenv conda (c) 2024, George S. Easton