1ap / google-api-python-client

Automatically exported from code.google.com/p/google-api-python-client
Other
0 stars 0 forks source link

Dependency on httplib2>=0.7.4 is inconvenient #125

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Ubuntu Lucid machines ship with httplib2 0.7.2. This conflicts with the 
setup.py for the python client library, which requires at least 0.7.4. If the 
line 'httplib2>=0.7.4' inside setup.py were instead 'httplib2>=0.7.2', then it 
would be possible to run "sudo pip install google-api-python-client" without 
first uninstalling the python-httplib2 package supplied by the system. 
(Uninstalling that package requires removing various end-user software that 
people may or may not care about.) Users who don't yet have httplib2 on their 
system would still get the most recent version.

Ubuntu Lucid is especially relevant for Google engineers running Goobuntu. 
Loosening this requirement would make it easier for Googlers to use the Python 
client libraries.

Original issue reported on code.google.com by jacobly@google.com on 16 Apr 2012 at 11:08

GoogleCodeExporter commented 8 years ago
First, google-api-python-client requires 0.7.4 because it needs bug fixes that 
are not present in 0.7.2.

Second, the suggested installation mechanism is easy_install. I'm not sure 
about pip, but easy_install does not require a separate step of uninstalling 
httplib2 before installing a later version. I just tried this on a freshly 
imaged system:

jcgregorio@gregorio3:~$ sudo apt-get install python-setuptools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  python-setuptools
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 213kB of archives.
After this operation, 922kB of additional disk space will be used.
Get:1 http://ubuntumirror.mirror.corp.google.com/ubuntu/ lucid/main 
python-setuptools 0.6.10-4ubuntu1 [213kB]
Fetched 213kB in 0s (503kB/s)           
Selecting previously deselected package python-setuptools.
(Reading database ... 209154 files and directories currently installed.)
Unpacking python-setuptools (from 
.../python-setuptools_0.6.10-4ubuntu1_all.deb) ...
Setting up python-setuptools (0.6.10-4ubuntu1) ...

Processing triggers for python-central ...
jcgregorio@gregorio3:~$ sudo easy_install google-api-python-client
Searching for google-api-python-client
Reading http://pypi.python.org/simple/google-api-python-client/
Reading http://code.google.com/p/google-api-python-client/
Best match: google-api-python-client 1.0beta8
Downloading 
http://google-api-python-client.googlecode.com/files/google-api-python-client-1.
0beta8.zip
Processing google-api-python-client-1.0beta8.zip
Running google-api-python-client-1.0beta8/setup.py -q bdist_egg --dist-dir 
/tmp/easy_install-GwXKeO/google-api-python-client-1.0beta8/egg-dist-tmp-EnhxkI
warning: no files found matching '*.png' under directory 'samples'
zip_safe flag not set; analyzing archive contents...
apiclient.discovery: module references __file__
Adding google-api-python-client 1.0beta8 to easy-install.pth file
Installing enable-app-engine-project script to /usr/local/bin

Installed 
/usr/local/lib/python2.6/dist-packages/google_api_python_client-1.0beta8-py2.6.e
gg
Processing dependencies for google-api-python-client
Searching for python-gflags
Reading http://pypi.python.org/simple/python-gflags/
Reading http://code.google.com/p/python-gflags
Best match: python-gflags 2.0
Downloading 
http://python-gflags.googlecode.com/files/python_gflags-2.0-py2.6.egg
Processing python_gflags-2.0-py2.6.egg
creating /usr/local/lib/python2.6/dist-packages/python_gflags-2.0-py2.6.egg
Extracting python_gflags-2.0-py2.6.egg to /usr/local/lib/python2.6/dist-packages
Adding python-gflags 2.0 to easy-install.pth file

Installed /usr/local/lib/python2.6/dist-packages/python_gflags-2.0-py2.6.egg
Searching for oauth2
Reading http://pypi.python.org/simple/oauth2/
Reading http://github.com/simplegeo/python-oauth2
Best match: oauth2 1.5.211
Downloading 
http://pypi.python.org/packages/source/o/oauth2/oauth2-1.5.211.tar.gz#md5=987ad7
365a70e2286bd1cebb344debbc
Processing oauth2-1.5.211.tar.gz
Running oauth2-1.5.211/setup.py -q bdist_egg --dist-dir 
/tmp/easy_install-K3ATpp/oauth2-1.5.211/egg-dist-tmp-XyyjK_
Adding oauth2 1.5.211 to easy-install.pth file

Installed /usr/local/lib/python2.6/dist-packages/oauth2-1.5.211-py2.6.egg
Searching for httplib2>=0.7.4
Reading http://pypi.python.org/simple/httplib2/
Reading http://code.google.com/p/httplib2/
Best match: httplib2 0.7.4
Downloading http://httplib2.googlecode.com/files/httplib2-0.7.4.zip
Processing httplib2-0.7.4.zip
Running httplib2-0.7.4/setup.py -q bdist_egg --dist-dir 
/tmp/easy_install-3Mb70G/httplib2-0.7.4/egg-dist-tmp-oPShbg
zip_safe flag not set; analyzing archive contents...
httplib2.__init__: module references __file__
Adding httplib2 0.7.4 to easy-install.pth file

Installed /usr/local/lib/python2.6/dist-packages/httplib2-0.7.4-py2.6.egg
Finished processing dependencies for google-api-python-client
jcgregorio@gregorio3:~$ 

Original comment by jcgregorio@google.com on 17 Apr 2012 at 12:53

GoogleCodeExporter commented 8 years ago
Weird: I tried a fresh system that had httplib2 0.7.2 as provided by 
python-httplib2 on Lucid, and where pip complained that httplib2 conflicted, 
easy_install happily installed the newer version.

Pip has theoretical advantages, but I guess I'll recommend that people use 
easy_install for this. Thanks.

Original comment by jacobly@google.com on 17 Apr 2012 at 2:26

GoogleCodeExporter commented 8 years ago
Oh. Turns out "pip install --upgrade google-api-python-client" would also have 
worked. Sorry for the noise.

Original comment by jacobly@google.com on 17 Apr 2012 at 2:48

GoogleCodeExporter commented 8 years ago
Oh, that's good to know if anyone else runs into that issue, thanks!

Original comment by jcgregorio@google.com on 17 Apr 2012 at 2:54

GoogleCodeExporter commented 8 years ago
It may allow the library to be installed, but the lib will still be linking 
against the old version of the lib, because the httplib2 installed by apt-get 
will take priority over the lib installed by pip. 

Original comment by zepp...@gmail.com on 7 Sep 2012 at 4:40

GoogleCodeExporter commented 8 years ago
I strongly suggest you use a virtualenv if at all possible. You don't want to 
be messing around with the system Python to run an app.

Original comment by afs...@google.com on 7 Sep 2012 at 4:50