How-to articles, tricks, and solutions about PYTHON-2.7

Cannot find module cv2 when using OpenCV

The error message "Cannot find module cv2" usually indicates that the OpenCV library is not installed on your system, or that Python is unable to find the library.

Convert list to tuple in Python

You can convert a list to a tuple in Python by using the built-in tuple() function.

How to fix: "UnicodeDecodeError: 'ascii' codec can't decode byte"

The "UnicodeDecodeError: 'ascii' codec can't decode byte" error occurs when trying to decode non-ASCII bytes using the ASCII codec.

How to install PIL with pip on Mac OS?

To install PIL (Python Imaging Library) using pip on Mac OS, you can use the following command in your terminal:

How to uninstall Python 2.7 on a Mac OS X 10.6.4?

To uninstall Python 2.7 on a Mac OS X 10.6.4, you can use the following commands in the terminal: