I am trying to use httplib2 in Python 2.7 on Windows 7 using the IDLE PythonWin 32 build 219.
I downloaded it and installed using python setup.py install
method.
On Windows command line the following is successful:
python
import httplib2
httplib2
<module 'httplib2' from 'C:\Python27\ArcGISx6410.2\lib\site-packages\httplib2-0.9.2-py2.7.egg\httplib2\__init__.pyc'>
Here's the problem: in PythonWin importing httplib2 returns:
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
ImportError: No module named httplib2
I added the location of the module returned in command line (above) using sys.path.append
in command line hoping that would resolve the issue.
PythonWin still cannot import the module, and sys.path
in PythonWin does not return the appended path to httplib2. I appended the path the same way in PythonWin, but still could not import the module, and when I reopened PythonWin, the path did not cotain the appended module anymore.
Why or how could PythonWin be using a different path, and how can I get PythonWin to be able to import httplib2?
Have you tried using the command line tool pip
? You can use it like so:
pip install httplib2
That should put it on your path. If you don't have pip installed see this post. Also, worth mentioning, httplib2
is not as friendly as requests which I personally prefer.