Fix Python – ImportError: No module named six

I’m trying to build OpenERP project, done with dependencies. It’s giving this error now
Traceback (most recent call last):
File “openerp-client.py”, line 105, in
File “modules\__init__.pyo”, line 23, in
File “modules\gui\__init__.pyo”, line 22, in
File “modules\gui\main.pyo”, line 33, in
File “rpc.pyo”….

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 – ImportError: cannot import name main when running pip –version command in windows7 32 bit

I’ve installed the latest python (2.7.9) bundled with pip and setuptools for windows 32-bit. I’ve tried reinstalling pip but the problem persists.
Here’s the error after running pip –version in Administrator cmd:
Traceback (most recent call last):
File “D:\Python\lib\runpy.py”, line 162, in _run_module_as_main
“__main__”, fname, loader, pkg_na….

Fix Python – “ImportError: No module named” when trying to run Python script

I’m trying to run a script that launches, amongst other things, a python script. I get a ImportError: No module named …, however, if I launch ipython and import the same module in the same way through the interpreter, the module is accepted.
What’s going on, and how can I fix it? I’ve tried to understand how python uses PYTHONPATH but I’m th….

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 fix “Attempted relative import in non-package” even with __init__.py

I’m trying to follow PEP 328, with the following directory structure:
pkg/
__init__.py
components/
core.py
__init__.py
tests/
core_test.py
__init__.py

In core_test.py I have the following import statement
from ..components.core import GameLoopEvents

However, when I run, I get the following error:
tests$ python core_test.py ….