Python error import: unable to open X server

Tags: ,

When you run python from shell, you may encounter the following error:

import: unable to open X server `' @ error/import.c/ImportImageCommand/368

Double check you have  the proper shebang line in the beginning of your python script:

#!/usr/bin/env python

Once your set the shebang line, you can run your python script as :

./file.py