0

I'm running OS X 10.10 and I have googlecl installed via pip:

$ pip show googlecl
---
Name: googlecl
Version: 0.9.14
Location: /usr/local/lib/python2.7/site-packages
Requires: gdata

and the README shows that you can call it like this:

$ google blogger post --title "foo" "command line posting"

so I assumed there must be a google executable, but there isn't.

How can I run googlecl?

$ ls /usr/local/lib/python2.7/site-packages/googlecl/
total 280
drwxr-xr-x  21 root    admin   714B Oct 24 11:58 .
drwxr-xr-x  62 manuel  admin   2.1K Nov 21 11:20 ..
-rw-r--r--   1 root    admin   8.8K Feb 11  2013 __init__.py
-rw-r--r--   1 root    admin   8.4K Feb 11  2013 __init__.pyc
-rw-r--r--   1 root    admin   9.3K Feb 11  2013 authentication.py
-rw-r--r--   1 root    admin   9.0K Feb 11  2013 authentication.pyc
-rw-r--r--   1 root    admin    28K Feb 11  2013 base.py
-rw-r--r--   1 root    admin    25K Feb 11  2013 base.pyc
drwxr-xr-x   6 root    admin   204B Oct 24 11:58 blogger
drwxr-xr-x  10 root    admin   340B Oct 24 11:55 calendar
-rw-r--r--   1 root    admin   5.4K Feb 11  2013 client.py
-rw-r--r--   1 root    admin   4.4K Feb 11  2013 client.pyc
drwxr-xr-x   6 root    admin   204B Oct 24 12:00 config
drwxr-xr-x  10 root    admin   340B Oct 24 12:00 contacts
drwxr-xr-x  12 root    admin   408B Oct 24 12:04 discovery
drwxr-xr-x  10 root    admin   340B Oct 24 11:56 docs
drwxr-xr-x   6 root    admin   204B Oct 24 11:55 finance
drwxr-xr-x   6 root    admin   204B Oct 24 11:55 picasa
-rw-r--r--   1 root    admin   5.5K Feb 11  2013 service.py
-rw-r--r--   1 root    admin   4.9K Feb 11  2013 service.pyc
drwxr-xr-x   6 root    admin   204B Oct 24 11:58 youtube

Python was installed via homebrew:

$ brew info python
python: stable 2.7.8 (bottled), HEAD
https://www.python.org
/usr/local/Cellar/python/2.7.3 (5169 files, 79M)
/usr/local/Cellar/python/2.7.5 (4.0K)
  Built from source
/usr/local/Cellar/python/2.7.8_1 (4842 files, 77M) *
  Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/python.rb
==> Dependencies
Build: pkg-config ✔
Required: openssl ✔
Recommended: readline ✔, sqlite ✘, gdbm ✔
==> Options
--quicktest
  Run `make quicktest` after the build (for devs; may fail)
--universal
  Build a universal binary
--with-brewed-tk
  Use Homebrew's Tk (has optional Cocoa and threads support)
--with-dtrace
  Experimental DTrace support (http://bugs.python.org/issue13405)
--with-poll
  Enable select.poll, which is not fully implemented on OS X (http://bugs.python.org/issue5154)
--without-gdbm
  Build without gdbm support
--without-readline
  Build without readline support
--without-sqlite
  Build without sqlite support
--HEAD
  install HEAD version
==> Caveats
Setuptools and Pip have been installed. To update them
  pip install --upgrade setuptools
  pip install --upgrade pip

You can install Python packages with
  pip install <package>

They will install into the site-package directory
  /usr/local/lib/python2.7/site-packages

See: https://github.com/Homebrew/homebrew/wiki/Homebrew-and-Python

.app bundles were installed.
Run `brew linkapps` to symlink these to /Applications.

pip version:

$ pip --version
pip 1.5.6 from /usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg (python 2.7)
Manuel Meurer
  • 3,238
  • 6
  • 35
  • 50

3 Answers3

2

You will not find a bin in every pip installation. There can be a executable script.

To be sure about this, you should look at the setup.py of the package. It is here If you look at the script, and variable SCRIPT_TO_INSTALL, you will see that the main entry point is not a binary but this script at src/google.py.

iamkhush
  • 2,562
  • 3
  • 20
  • 34
  • Thanks for the explanation! I guess my real question is, how do I run `googlecl` then? [The README](https://code.google.com/p/googlecl/) shows that you can call it with `google ...` so I was looking for a `google` executable. As you can see in my question, there is no `src/google.py` in `/usr/local/lib/python2.7/site-packages/googlecl/` – Manuel Meurer Nov 22 '14 at 10:07
  • src/google.py is in the src package , not in the result package. You can say that when you do a `google..` , it calls googlecl, meaning, this script acts as a wrapper around the main library. You can look in the code for more info on how it does things underneath. I guess, you can also directly import googlecl library. – iamkhush Nov 22 '14 at 13:53
  • Sorry, I don't understand. I don't want to import googlecl or read the code. What exactly do I have to do to be able to call `google blogger post --title "foo" "command line posting"` for example, one of the examples from [the README](https://code.google.com/p/googlecl/), from the command line? – Manuel Meurer Nov 22 '14 at 17:52
1

On my Ubuntu it is at /usr/local/bin/google. Try finding it with find /usr -name google.

Tomo
  • 3,431
  • 5
  • 25
  • 28
  • Thanks, but I'm on OS X, not Ubuntu, added that to the question. :) Couldn't find the executable in `/usr` – Manuel Meurer Nov 22 '14 at 09:58
  • @ManuelMeurer: Find it anywhere: `find / -mount -name google` Isn't there a Finder app on the Mac OS X which can find files for you? You my want to use it. Or you may want to ask a question on superuser.com how to find files on the Mac OS X. – pts Nov 22 '14 at 10:00
  • Yes, sure there is a Finder app. A google executable cannot be found. I guess my real question is how to run `googlecl` if not with an executable, since [the README](https://code.google.com/p/googlecl/) shows that you can call it with `google ...` – Manuel Meurer Nov 22 '14 at 10:04
  • I just installed it on my Mac. The binary is also at `/usr/local/bin/google`. – Tomo Nov 22 '14 at 20:36
  • @Tomo, did you install it via pip as well? Is `/usr/local/bin/google` a symlink, if yes, where to? What's the content of your `/usr/local/lib/python2.7/site-packages/googlecl/`? Feel free to put all that in a separate answer. :) – Manuel Meurer Nov 23 '14 at 13:26
  • Yes, I installed it via pip. There are some differences: I didn't install python via brew but directly. And I have pip in an ancient version (1.0.2). The `google` binary is not a symlink. The googlecl package is at `/Library/Python/2.7/site-packages/google-cl/`. So, I think the fact that I don't have the brew version of Python makes the whole difference. Try looking for the google binary in your cellar (`/usr/local/Cellar/`). – Tomo Nov 24 '14 at 07:26
  • Okay, finally solved it... I reinstalled `googlecl`, which I did before but it didn't solve the problem, but additionally reinstalled `google`, which fixed it! Thanks for the help, @Tomo! – Manuel Meurer Nov 24 '14 at 13:13
0

In the end, reinstalling googlecl and google via pip fixed it and put the executable in /usr/local/bin/google.

Manuel Meurer
  • 3,238
  • 6
  • 35
  • 50