Fix Python – ImportError: libSM.so.6: cannot open shared object file: No such file or directory

When trying to import OpenCV, using import cv2 I get the following error:
/usr/local/lib/python2.7/dist-packages/cv2/__init__.py in ()
7
8 # make IDE’s (PyCharm) autocompletion happy
—-> 9 from .cv2 import *
10
11 # wildcard import above does not import “private” variables like __version__

ImportError: libSM.so.6….

Fix Python – Unable to import a module that is definitely installed

After installing mechanize, I don’t seem to be able to import it.
I have tried installing from pip, easy_install, and via python setup.py install from this repo: https://github.com/abielr/mechanize. All of this to no avail, as each time I enter my Python interactive I get:
Python 2.7.3 (default, Aug 1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type “….

Fix Python – How to write a Python module/package?

I’ve been making Python scripts for simple tasks at work and never really bothered packaging them for others to use. Now I have been assigned to make a Python wrapper for a REST API. I have absolutely no idea on how to start and I need help.
What I have:
(Just want to be specific as possible) I have the virtualenv ready, it’s also up in github, th….