Tuesday, July 17, 2012

Getting Ready with Python-PIP

As I mentioned in my earlier post on Python in Eclipse [PyDev Plugin for Eclipse], that I am new to Python. I decided to post the issues I face during my Python experience. And for this post the motivation was python-pip

What is Python-pip?

pip is a tool for installing and managing Python packages, like the ones which can be found under the Python Package Index. It's a replacement for a previous tool, easy_install. More details can be found here.

Dependencies of Python-pip

  • Python 2.7: If you don't have python installed then you can follow the instruction from Tutorial Point.
  • Python setup tools.
    In case if you don't have python-setup-tools then:
    • Download the RPM installer package for python-setup-tools. In my case I am on Linux Fedora 14 and downloaded the RPM package file from here.
    • Once you have downloaded the python-setup-tools RPM package file. Install it with RPM command from shell:
      rpm -i python-setuptools-0.6.14-3.fc14.noarch.rpm
    • And its done for python-setup-tools.

Installing Python-pip

After getting all the dependencies, you are all set to install the python-pip package. The first thing to do now is to download the python-pip RPM installer for your linux version. As mentioned earlier that I am using Fedora 14, I downloaded the rpm package file for python-pip from here.
rpm -i python-pip-0.8.3-1.fc14.noarch.rpm
After this, the you are ready to use python-pip to install python packages.

Using Python-pip

The list of package that can be installed using python-pip can be found here.

To get packages:

To get and install a package using python-pip, simply run following command: 
$ pip install {package_name}
 or if that doesn't work then try:
$ pip-python install {package_name}


To uninstall a package:

To remove a python package, run following command:
$ pip-python uninstall {package_name}

To upgrade a package:

To remove a python package, run following command:
$ pip-python --upgrade {package_name}

I hope this helps you. Feel free to share your experience/issues.

No comments:

Follow by Email