1

I'm trying to set up the Python Google API on my system; I have both Python 2.6 and 2.7 installed; 2.7 is the version I use. Howver, the installer installs itself into my old Python (2.6) and I get library not found errors when I try to use it on 2.7.

Has anybody had any success installing the Google API into a specific version of Python?

Thanks!

3
  • What steps do you take, what are you trying, etc? Commented Jul 9, 2011 at 23:59
  • It's a fairly new system: Ubuntu 10.04, recently reinstalled after I broke it. The version it came with was 2.6, and I installed 2.7 yesterday. Forgot to use altinstall or whatever so something fishy may have happened there. Then today I installed the Google API library and ran the initial tests. Everything went fine except for the atom_tests.mock_http_test.MockHttpClientUnitTest, and I didn't understand what the problem was, so I let that be for the moment and tried running the examples from Google. Everything failed and I checked the installation output; it turns out everything Commented Jul 10, 2011 at 0:47
  • had been installed into 2.6 instead of 2.7. If I can reinstall into 2.7 I think everything will be OK, but the Google documentation didn't mention that contingency. Right now all I can think of is reinstall Python 2.6, delete 2.7 and try again. But I don't know how to safely delete a Python installation either. There seemed to be a whole lot of system reconfiguration when I installed 2.7. Commented Jul 10, 2011 at 0:50

1 Answer 1

1

Generally to install a package you either download it and run python setup.py install or use easy_install/pip. You can use which python to verify you are running the installer with the proper version of Python. There is a good chance you are simply installing it with 2.6, thus it never gets installed for 2.7. If you are trying to use system packages to install this package, it might be easier to just download it yourself and run python setup.py install with the proper python executable.

Sign up to request clarification or add additional context in comments.

5 Comments

That's the thing: which python doesn't return the version, only the location. python -V gives me the version, but it gives me 2.7, which is (ostensibly) as it should be. Do you think it would be safe to just reinstall 2.6?
or maybe I can just move the gdata files out of the 2.6 directory where they're installed and put them in the 2.7 directory? (I tried installing 2.6 and it just tells me that 2.6 is already up to date and thus does nothing)
Hmm. I just reinstalled 2.6 and then reinstalled the API, using setup.py install. But the test program that Google gives at the end of the install returns this error: |||||||| Traceback (most recent call last): File "./test.py", line 1, in <module> import gdata.docs.service ImportError: No module named gdata.docs.service ||||||| Frustrating...
Grr... also, I decided to browse the filesystem to my Python directory to check for the modules and they're ALL THERE. gdata.docs.service.py is right there, but for some reason python can't find it. This is really confusing... even in the interactive shell I can't import it.
export PYTHONPATH=/usr/local/lib/python2.6/dist-packages

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.