tekgiant
Posts: 7
Joined: Tue Jun 18, 2013 3:28 am

Installing Google API Directory

Tue Jun 18, 2013 6:42 am

First off I apologize if this is not the best section for this.

I just got my RPi up and running for the first time. So far, all I've done is install Chromium on it.

I'm trying to install the Google API directory for Python so I can try an experiment with Google Calendar and I am quite obviously a noob at this because even these seemingly simple instructions are not working for me.
Installing the Google Data Library

Download the Google Data Python library if you haven't done so. Look for the latest version on the Python project's downloads page.

After downloading the library, unpack it using unzip or tar zxvf depending on the type of download you chose.

Now you are ready to install the library modules so that they can be imported into Python. There are several ways you can do this:

If you have the ability to install packages for all users to access, you can run

Code: Select all

./setup.py install 
from the unpacked archive's main directory.
If you want to install these modules for use in your home directory, you can run

Code: Select all

./setup.py install --home=<your home directory>
.
In some cases, you want to avoid installing the modules altogether. To do that, modify your PYTHONPATH environment variable to include a directory which contains the gdata and atom directories for the Google Data Python client library. For instructions on modifying your PYTHONPATH, see the Appendix at the end of this article.

One final option that I'll mention, is copying the gdata and atom directories from the src directory into whatever directory you are in when you execute python. Python will look in the current directory when you do an import, but I don't recommend this method unless you are creating something quick and simple.
Once you've installed the Google Data library, you're ready to take the library for a test drive.
That's from the Google Developer site.

I'm not sure what the commands are there that start with "./" but they don't work for crap on my terminal. I've downloaded the gdata zip file as directed in the instructions and unzipped it to a directory I made. If someone could help me with this from that point to get python to be able to use the Google API stuff properly, I'd really appreciate it. You might need to really dumb your instructions down for me. Thanks

Michael

User avatar
paddyg
Posts: 2555
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Installing Google API Directory

Tue Jun 18, 2013 9:14 am

I don't know anything about the google calender files you're trying to install but those "./" lines are a linux way of running a file in the same directory as you've cd to.
The python file setup.py will start with a line like #!/usr/bin/python which tells the system to run it using python. So typing
./setup.py install
should be the equivalent of typing
python setup.py install
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

tekgiant
Posts: 7
Joined: Tue Jun 18, 2013 3:28 am

Re: Installing Google API Directory

Tue Jun 18, 2013 9:54 pm

Well, any command with "./" in front of it always returns an error. So, I'm not sure what the issue is there.

User avatar
paddyg
Posts: 2555
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Installing Google API Directory

Tue Jun 18, 2013 10:58 pm

they're not really commands but rather paths/file names relative to current directory. I assume you have changed directory to the same one with the unzipped files?

you might try
sudo python setup.py install
which it mentions near the top of the INSTALL.txt file but not later. i.e. setup will probably need root privileges
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

tekgiant
Posts: 7
Joined: Tue Jun 18, 2013 3:28 am

Re: Installing Google API Directory

Tue Jun 18, 2013 11:40 pm

I changed to the directory that the Google API files are in and tried running the command you suggested. This is what i got:

Code: Select all

pi@raspberrypi ~/GAP $ sudo python setup.py install
python: can't open file 'setup.py': [Errno 2] No such file or directory
pi@raspberrypi ~/GAP $ 
So, I'm kind of at a loss. Anyone else that has successfully uploaded the Google API Directory for Python could really be of some help here.

User avatar
paddyg
Posts: 2555
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Installing Google API Directory

Wed Jun 19, 2013 11:33 am

obviously you've got to be in the same directory as the setup.py file. You sound to be still in the wrong place! i.e on my pi
pi@raspberrypi ..$ cd ~/GAP/gdata-2.0.18
pi@raspberrypi ..$ sudo python setup.py install
but it depends where you unzipped it to on yours.

PS not sure what I've installed but the tests seem to run (until they can't cope with the random info I enter)
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

Return to “Python”