Pip is the most popular tool and the command used to install 3rd party packages into Python. Pip can be used for both PYython2 and Python3. In this tutorial, we will learn how to install a specific version of a Python package with the pip command. The problem is an old one though, and the fix is quite old as well, and backportable to other Python versions. Regardless, if you want to use pyenv to build Python on Cygwin, there have been many patches needed for Python on Cygwin across different versions, and you may need to apply several of them for each Python version you want to install.
One thing I really love with the Python programming language is its incredible extensibility.
Here’s a list of 50 awesome modules for Python, covering almost all needs: Databases, GUIs, Images, Sound, OS interaction, Web, and more.
Graphical Interface
The Python Standard Library comes with TkInter, but you can take your GUIs to the next level using an external Python module.
wxPython: Create truly native user interfaces for their Python applications that run with little or no modifications on Windows, Mac and Linux or other Unix-like systems.
PyGObject: Python package which provides bindings for GObject based libraries such as GTK, GStreamer, WebKitGTK, GLib, GIO, and many more.
Pmw: Toolkit for building high-level compound widgets in Python using the Tkinter module.
WCK : Extension API that allows you to implement all sorts of custom widgets, in pure Python.
Tix: A powerful set of user interface components that expands the capabilities of your Tcl/Tk and Python applications. Using Tix together with Tk will greatly enhance the appearance and functionality of your application.
Databases
The following open-source modules will allow you to easily access data stored in databases.
MySQLdb: Python DB API-2.0-compliant interface for accessing MySQL databases.
PyGreSQL: An open-source module that interfaces to a PostgreSQL database. It embeds the PostgreSQL query library to allow easy use of the powerful PostgreSQL features from a Python script.
Gadfly: A simple relational database system implemented in Python based on the SQL Structured Query Language.
SQLAlchemy: A Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL.
KInterbasDB: A Python extension package that implements Python Database API 2.0-compliant support for the open source relational database Firebird and some versions of its proprietary cousin Borland Interbase.
Web Development
Python is a popular language for web development. Each Python package listed below will make your web developer life much easier.
Beautiful Soup: A Python library designed for quick turnaround projects like screen-scraping.
scrape: A Python module for web browsing and scraping.
mechanize: Stateful programmatic web browsing in Python.
libgmail: A pure Python binding to provide access to Google’s Gmail web-mail service.
Google Maps: This library brings the Google Maps Platform Web Services to your Python application.
Requests allows you to send HTTP/1.1 requests extremely easily.
Selenium: With this module, developers can programmatically open webpages, enter fields, click buttons, and submit forms.
pyquery allows you to make jQuery queries on XML documents. The API is as much as possible the similar to jQuery. Pyquery uses LXML for fast XML and HTML manipulation.
Image and Video Manipulation
Python is a very powerful language that can accomplish many tasks such as image manipulation. The Standard Library doesn’t provide any image manipulation built-in module, but the following will definitely help.
Python Imaging Library (PIL): PIL adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities.
GDmodule: An interface to the GD library written by Thomas Boutell.
VideoCapture: A Win32 Python extension for accessing video devices such as USB WebCams and TV cards.
MoviePy: A Python library for video editing: cutting, concatenations, title insertions, video compositing (a.k.a. non-linear editing), video processing, and creation of custom effects.
pyscreenshot: A cross-platform module that allows to take screenshots without installing 3rd party libraries.
Data Science and Maths
Python features many extensions that can be used for scientific needs such as maths, data science, and engineering.
SciPy: SciPy (pronounced “Sigh Pie”) is a Python-based ecosystem of open-source software for mathematics, science, and engineering.
Matplotlib: A Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. Matplotlib can be used in Python scripts, the Python interpreter, the Jupyter notebook, web application servers, and four graphical user interface toolkits.
Pandas: A fast, powerful, flexible and easy-to-use open source data analysis and manipulation tool.
Numpy: A library adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays.
Game Development
Python is a versatile language that allows programmers to create many different types of apps, including video games.
Pygame: A set of modules designed for writing video games. Pygame adds functionality on top of the excellent SDL library. This allows you to create fully featured games and multimedia programs in the Python language.
Pyglet: A powerful, yet easy to use Python library for developing games and other visually-rich applications on Windows, Mac OS X, and Linux.
pyOpenGL: The most common cross platform Python binding to OpenGL and related APIs.
Sound
Sound manipulation is easily done in Python, thanks to a few very useful modules.
pySonic: A Python wrapper around the high performance, cross platform FMOD sound library.
PyMedia: A Python module for WAV, MP3, Ogg, AVI, DivX, DVD, CD-DA etc. file manipulations. It allows you to parse, demultiplex, multiplex, decode and encode all supported formats. It can be compiled for Windows, Linux, and Cygwin.
PMIDI: The PMIDI library wraps the Windows MIDI Streams library for use in Python. Using PMIDI, developers can generate synthesized musical sequences on the fly in their code for playback to users.
Mutagen: A module to handle audio metadata. It supports FLAC, M4A, Musepack, MP3, Ogg FLAC, Ogg Speex, Ogg Theora, Ogg Vorbis, True Audio, and WavPack audio files.
Microsoft Windows
If you are developing applications for Microsoft Windows, the following modules can help make your app better integrated with the OS.
pywin32: A wrapper of Python that allows us to interact with COM objects and automate Windows applications with Python.
PyRTF: A set of Python classes that make it possible to produce RTF documents from Python programs.
WMI: The Python WMI module is a lightweight wrapper on top of the pywin32 extensions, and hides some of the messy plumbing needed to get Python to talk to the WMI API.
Py2exe converts Python scripts into executable Windows programs, able to run without requiring a Python installation.
Mac OS
Python integrates very well with Mac OS. The following modules are very helpful if you are developing for Apple’s OS.
py2app: A Python setuptools command that will allow you to make standalone Mac OS X application bundles and plugins from Python scripts.
PyObjC: PyObjC is a bridge between Python and Objective-C. It allows full featured Cocoa applications to be written in pure Python.
USB and Serial Ports
Did you know that using Python, you can access your computer’s USB and Serial ports? The following modules will help when you need to accomplish such tasks.
Cygwin Python 3
PyUSB aims to be an easy-to-use Python module to access USB devices. PyUSB relies on a native system library for USB access. Currently, it works out of the box with libusb 0.1, libusb 1.0, libusbx, libusb-win32 and OpenUSB, and works with any Python version starting at 2.4, including Python 3 releases.
PySerial: Python serial port access library.
USPP is a multi-platform Python module to access serial ports. At the moment, it only works in Windows.
Miscellaneous Modules
This table features interesting modules that didn’t fit in any of the above categories.
Category | Name | URL |
---|---|---|
Network | Twisted | http://twistedmatrix.com/ |
Jabber | jabberpy | http://jabberpy.sourceforge.net/ |
Expect | pyExpect | https://pexpect.readthedocs.io/en/latest/ |
3D | VPython | http://vpython.org |
What are Modules in Python?
A module is a file consisting of Python code. A module can define functions, classes and variables, and extends the functionalities offered by the built-in modules.What are Python Built-In Modules?
Built-In Modules come with Python and are installed by default. You can view the built-in modules included in the Standard Library on the official documentation.How to List All Installed Python Modules?
The easiest way to list installed Python modules is by using thehelp
function from the Python command prompt:On Linux systems, you can use python-pip and the pip freeze
command to list installed modules:Is Python an Easy Language to Learn?
Python code has a concise and relatively easy syntax, that will look similar to those used to Perl. If you plan to become a web developer, use the Python tutorials available online, as Python is great as a first language.For experienced developers, learning Python is generally a quick and very smooth process.- Related Questions & Answers
- Selected Reading
If you have Python 2 >=2.7.9 or Python 3 >=3.4 installed from python.org, you will already have pip and setuptools, but will need to upgrade to the latest version:
On Linux or macOS:
On Windows:
If you’re using a Python install on Linux that’s managed by the system package manager (e.g 'yum', 'apt-get' etc…), and you want to use the system package manager to install or upgrade pip, then see: https://packaging.python.org/guides/installing-using-linux-tools/
Otherwise:
Download get-pip.py from https://bootstrap.pypa.io/get-pip.py. Run python get-pip.py. This will install or upgrade pip.
Now you can use pip to install python packages. For example, To install the latest version of 'SomeProject':
To install a specific version:
Cygwin How To Install Python Modules In Windows
To install greater than or equal to one version and less than another: