3

I found this xgoogle python modules http://github.com/pkrumins/xgoogle, very interesting. How exactly should i include or install these files in linux??

if i want to do something like this using xgoogle python module?

>>from xgoogle.search import GoogleSearch 

I know that we can use from, import to use modules, but to include an external module, what should i do? Should i need to install module or what?

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
Abhilash Muthuraj
  • 2,008
  • 9
  • 34
  • 48

2 Answers2

5

You could either do the usual install dance:

python setup.py install

or simply include the files in a known directory and include that directory in the PYTHONPATH:

$ export PYTHONPATH=/contains/modules:$PYTHONPATH

Here's a detailed documentation on Installing Python Modules: http://docs.python.org/install/

William Niu
  • 15,798
  • 7
  • 53
  • 93
  • In the directory of xgoogle, there is no install file, see the contents below `abhilash@abhilash:~/python_resources/xgoogle/xgoogle$ ls BeautifulSoup.py browser.py googlesets.py search.py translate.py BeautifulSoup.pyc browser.pyc __init__.py sponsoredlinks.py ` – Abhilash Muthuraj Oct 01 '10 at 14:52
  • what about one directory level above? There should be a `setup.py` file. – William Niu Oct 01 '10 at 14:56
0

You can install it with other python libraries / modules, or just put it in the same repository than your project.

Guillaume Lebourgeois
  • 3,796
  • 1
  • 20
  • 23