APP Lab Expt - 1
APP Lab Expt - 1
To see which version of Python 3 you have installed, open a command prompt and run
$ python3 --version
If you are using Ubuntu 16.10 or newer, then you can easily install Python 3.6 with the following commands:
If you are using other Linux distribution, chances are you already have Python 3 pre-installed as well. If not,
dnf:
Note that if the version of the python3 package is not recent enough for you, there may be ways of installing
more recent versions as well, depending on you distribution. For example installing the python3.9 package on
Fedora 32 to get Python 3.9. If you are a Fedora user, you might want to read about multiple Python versions
available in Fedora.
$ python
$ python3
Example:
gedit add, py
a=50
b=20
print ( a+b )
Save the program
go to save file
python add.py
70
OR
$gedit add.py
a= int (input nter a
b= int ( input ( enter b"))
C=a+b
print ( c)
https://docs.python.org/3/using/windows.html
Four Python 3.11 installers are available for download - two each for the 32-bit and 64-bit versions of the
interpreter. The web installer is a small initial download, and it will automatically download the required
components as necessary. The offline installer includes the components necessary for a default installation and
only requires an internet connection for optional features. See Installing Without Downloading for other ways
to avoid downloading during installation.
other options or post-install actions. To install debugging symbols or binaries, you will need to use this option.
To perform an all-
Install Pip3
pip3 is the official package manager and pip command for Python 3. It enables the installation and
management of third party software packages with features and functionality not found in the Python standard
library. Pip3 installs packages from PyPI (Python Package Index).
Installation Prerequisites
Check if pip3 is already installed by entering the following command in a terminal or command line:
pip3 v
Usage:
Commands:
...
...
You can also check to see which version of pip3 is installed by entering:
pip3 --version
Output should be similar to:
pip 20.0.2 from C:\Python38\lib\site-packages\pip (python 3.8)
Confirm which version of Python (if any) is installed on your computer by entering:
python --version
Pip3 Installation
Python 3.4+ in most operating systems includes pip3 by default. If your python version is less than 3.4, then
you should upgrade your Python version which will automatically install pip3.
For example, you can install the latest version of Python from ActiveState (Python 3.9), which includes pip3.
Pip3 Upgrade
In operating system environments that already have Python 3 and pip3 installations, you can upgrade pip3, by
entering:
You can downgrade to a previous version of pip3, in case a newer version is causing unexpected compatibility
errors. For example, to downgrade to pip3 v19.0 run the following command:
When pip3 is used in a virtual environment, it will generally install packages in a path similar to:
<virtualenv_name>/lib/<python_verion>/site-packages
Pip3 Usage
To install a Python package, enter:
Caution:
Linux and MacOS have system Python, that you should leave alone if possible. System Python is configured to
help the operating system work as intended.
Ubuntu 20.4 has only Python 3, but still requires a separate python-pip 3 installation.
To find the location where pip3 installs packages in Ubuntu Linux, enter:
which pip3
/usr/bin/pip3
To install or upgrade pip3 in a Windows environment that already has Python 3 installed:
<https://bootstrap.pypa.io/>
CD into the directory where get-pip.py was downloaded to, and enter the following command to install pip3
and its dependencies:
python3 get-pip.py
You can verify that pip3 is installed by navigating to the default pip3 installation directory, eg.
C:\python38\scripts\, and enter:
pip3 --version
To install pip3 in a MacOS environment that already has Python 3 installed, enter:
To install pip3 using the Homebrew package manager (if it is installed), enter:
get-pip.py will install pip3 for the python version which runs the script.
Pip3 has limited use in the Conda environment compared to other operating system environments.
Conda has many of the features found in pip3, but is otherwise a completely separate tool. It installs python
modules and packages from the Anaconda Repository. Only after Conda has been used to install as many
packages as possible in a project, should pip3 be used to install any remaining software.
It depends on whether you are familiar with pip3 and Conda, and with how package installations interact
between the two methods. If you are relatively new to Conda and Python, then only use Conda to install
packages in Conda environments. Otherwise pip3 can be used to install packages not found in the Anaconda
Repository. Extra care needs to be taken with pip3 dependencies so that they do not conflict with Conda
packages and dependencies.
If Python 3 and pip3 are installed outside of the Conda environment, then you can run pip3 from an Anaconda
prompt just as you would from a Linux or Windows terminal or command line.
d) Installing numpy and scipy You can install any python3 package using the command
pip3 install
$ py -m pip version
$ py -m pip initall numpy
$ py -m pip install -- upgrade pip
$ py -m pip Version
$ py -m pip install pandas
$ py -m pip install matplotlib
go to start -> cmd -> command prompt will be opened
$ python -- Version
$ py -m pip -- Version
-m pip install scypy
$ py
>>> from scipy import constants
>>> print (constants. pi)
3.1415926535989793
>>> print (constants. kibi)
Output: 1094
e) Installing jupyterlab Install from pip using the command pip install jupyterlab
Anaconda installation :-
1) Go to chrome type anaconda
2) Open official website www.anaconda.com
3) go to pricing check pricing, check its free or not
4) Go to learn more -> toolkit download
Anaconda installers
Windows Macos Linux
64Bit 32 bit 64bit 32bit 64Bit 32 bit
Extra care needs to be taken with pip3 dependencies so that they do not conflict with conda packages and
dependencies.
If python 3 and pips are installed outside of the Conda environment, then you can run pip 3 from an Anaconda
prompt just as you would from a Linux or Windows terminal or command Line
If python 3 and pip3 are installed outside of the Conda Environment, then you can run pip3ffrom Anaconda
Prompt just as you would from a Linux or Windows terminal or command Line.
The Active state platform is a cloud- based build tool for python.
It provides build automation and vulnerability remediation for:
o python language cores, including python 2.7 and python 3.5 +
o python packages and their dependencies, including:
o Transitive dependences (i.e. .., dependencies of dependencies)
o Linked c and fortran libraries, so you can build data science packages
o Operating system- level dependencies for Windows, Linux and MacOs.
o Shared dependences (i.e Open SSL)
Find, fix and automatically rebuild a secure version of Python package. like Django and environments in
minutes.
Python package Management In Action.
Get a hands -on appreciation for how the Active state Platform can help you manage your dependencies for
python environments.
Just run the following command to install python 3.9 and our package manager, the state
Tool;
Windows
powerchell - Command "& $ ([scriptblock]:: Create ((New-object Net. Webclient). Downloadsting (" https : //
platform.activestate.com(di/cli/install .ps ))) active.default Activestate-babs/python-3.9 Beta"
Linux:
sh<(curl - qhttps:// platform.activestate.com/di/cli/install.sh) --active-default Activestate - habs/python -
3.9Beta.
Now you can run state install <packagename>.
Jupyter notebook
Ex->
1) In [1] : 3*6
Out [1]: 18
2) In [2] : 6 - 3
Out [2]: 3
3) In [3]: 10|2
out [3]: 5.0
4) In [4] : a=5
a*a*a
out[4]= 125