python # ImportError: No module named httplib2

   from httplib2 import Http
ImportError: No module named httplib2

解决方法:

[root@localhost enc_service]#  which -a python
/usr/bin/python

[root@localhost enc_service]# pip -V
pip 18.0 from /usr/lib/python2.7/site-packages/pip (python 2.7)

[root@localhost enc_service]# pip install httplib2
Collecting httplib2
  Downloading https://files.pythonhosted.org/packages/fd/ce/aa4a385e3e9fd351737fd2b07edaa56e7a730448465aceda6b35086a0d9b/httplib2-0.11.3.tar.gz (215kB)
    100% |████████████████████████████████| 225kB 151kB/s 
Building wheels for collected packages: httplib2
  Running setup.py bdist_wheel for httplib2 ... done
  Stored in directory: /root/.cache/pip/wheels/1b/9c/9e/1f6fdb21dbb1fe6a99101d697f12cb8c1fa96c1587df69adba
Successfully built httplib2
Installing collected packages: httplib2
Successfully installed httplib2-0.11.3
You are using pip version 18.0, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

其它类似问题:

  • ImportError: No module named yaml
pip install pyyaml

References:

https://stackoverflow.com/questions/22735496/importerror-no-module-named-httplib2-even-after-installation

你可能感兴趣的:(python # ImportError: No module named httplib2)