Skip to main content

Python PIP

 

Python PIP


What is PIP?

PIP is a package manager for Python packages, or modules if you like.

Note: If you have Python version 3.4 or later, PIP is included by default.


What is a Package?

A package contains all the files you need for a module.

Modules are Python code libraries you can include in your project.


Check if PIP is Installed

Navigate your command line to the location of Python's script directory, and type the following:

Example

Check PIP version:

C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip --version

Install PIP

If you do not have PIP installed, you can download and install it from this page: https://pypi.org/project/pip/


Download a Package

Downloading a package is very easy.

Open the command line interface and tell PIP to download the package you want.

Navigate your command line to the location of Python's script directory, and type the following:

Example

Download a package named "camelcase":

C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip install camelcase

Now you have downloaded and installed your first package!



Using a Package

Once the package is installed, it is ready to use.

Import the "camelcase" package into your project.

Example

Import and use "camelcase":

import camelcase

c = camelcase.CamelCase()

txt = "hello world"

print(c.hump(txt))


Find Packages

Find more packages at https://pypi.org/.


Remove a Package

Use the uninstall command to remove a package:

Example

Uninstall the package named "camelcase":

C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip uninstall camelcase

The PIP Package Manager will ask you to confirm that you want to remove the camelcase package:

Uninstalling camelcase-02.1:
  Would remove:
    c:\users\Your Name\appdata\local\programs\python\python36-32\lib\site-packages\camecase-0.2-py3.6.egg-info
    c:\users\Your Name\appdata\local\programs\python\python36-32\lib\site-packages\camecase\*
Proceed (y/n)?

Press y and the package will be removed.


List Packages

Use the list command to list all the packages installed on your system:

Example

List installed packages:

C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip list

Result:

Package         Version
-----------------------
camelcase       0.2
mysql-connector 2.1.6
pip             18.1
pymongo         3.6.1
setuptools      39.0.1

Comments

Popular posts from this blog

Python Introduction

  Python  Introduction What is Python? Python is a popular programming language. It was created by Guido van Rossum, and released in 1991. It is used for: web development (server-side), software development, mathematics, system scripting. What can Python do? Python can be used on a server to create web applications. Python can be used alongside software to create workflows. Python can connect to database systems. It can also read and modify files. Python can be used to handle big data and perform complex mathematics. Python can be used for rapid prototyping, or for production-ready software development. Why Python? Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc). Python has a simple syntax similar to the English language. Python has syntax that allows developers to write programs with fewer lines than some other programming languages. Python runs on an interpreter system, meaning that code can be executed as soon as it is written. This means that p...

LIST OF TOPICS YOU WILL BE LEARN THIS WHOLE SERIES

Python  Introduction    Python  Getting Started Python  Variables Python  Comments Python Try Except Python Data Types Python Casting Python Strings Python Operators Python Lists Python Tuples Python Sets Python Dictionaries Python Arrays Python PIP Python Booleans Python If  Else Python Loops Python Functions Python Lambda Function Python Modules Python Random Module Python cmath Module Python Math Module Python Classes and Objects Python Inheritance PYTHON FILE I/O                Video Contain 1. Telusko 2. CodeWithHarry For Certification Course 01. Udemy1 02. Udemy2                                                                                                     ...

Python Getting Started

  Python  Getting Started Python Install Many PCs and Macs will have python already installed. To check if you have python installed on a Windows PC, search in the start bar for Python or run the following on the Command Line (cmd.exe): C:\Users\ Your Name >python --version To check if you have python installed on a Linux or Mac, then on linux open the command line or on Mac open the Terminal and type: python --version If you find that you do not have python installed on your computer, then you can download it for free from the following website:  https://www.python.org/ Python Quickstart Python is an interpreted programming language, this means that as a developer you write Python (.py) files in a text editor and then put those files into the python interpreter to be executed. The way to run a python file is like this on the command line: C:\Users\ Your Name >python helloworld.py Where "helloworld.py" is the name of your python file. Let's write our first Python fi...