Python: Httplib2 Module Not Found

2019-02-05 20:23发布

I tried to import the module but i am getting the error shown below:-

sh-3.2# python -V
Python 2.6.4
sh-3.2# python -c "import httplib2"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named httplib2

How to fix this Error?

6条回答
我欲成王,谁敢阻挡
2楼-- · 2019-02-05 20:50

Download it?

Make sure it's on your PYTHONPATH

查看更多
神经病院院长
3楼-- · 2019-02-05 21:00

Suppose you can start by installing it like :

$ pip install httplib2

you can try the same thing with easy install too, or if you wanted to install in locally and not over the network then go to httplib2 github . Clone/download it to your computer. Now go to the downloaded httplib2 folder location and run the setup.py like this :

$ setup.py install

If on windows, make sure you have successfully installed python first and have set the environment variables path successfully.

This is a common command to install any module using pip or by locally downloading and looking for the foldert location>setup.py file and trying the second command mentioned above.

查看更多
手持菜刀,她持情操
4楼-- · 2019-02-05 21:08

httplib2 is not part of the Python standard library. It's an external package you must install yourself.

using pip:

pip install httplib2
查看更多
混吃等死
5楼-- · 2019-02-05 21:09

You need to install the httplib2 package from your package manager.

On Ubuntu: sudo apt-get install python-httplib2

查看更多
甜甜的少女心
6楼-- · 2019-02-05 21:13

FOR WINDOWS:

if python is installed & set as environment variable

python -m pip install httplib2

查看更多
一纸荒年 Trace。
7楼-- · 2019-02-05 21:14

I suppose you could start by installing httplib2.

查看更多
登录 后发表回答