1

Setup iMac 10.7.4, Eclipse Indigo, Pydev, Python 2.7

I’m trying to install the Tweepy API but the documentation is a bit sparse for any beginner programmer. I thought I had it installed as I had downloaded the necessary file to my applications folder and typed 'python setup.py install'

However I’m only now learning about the Pythonpath and the correct way of using import

Can anyone tell me where I should locate the Tweepy folder so that I can add it to the PythonPath

My Python "System libs" are all located in what I believe is a standard directory configuration

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/

EDIT: PythonPath Printout

['/Users/me/Documents/workspace/Tweeter/src',

 '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg',
 '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tweepy-1.7.1-py2.7.egg',

'/Users/me/Documents/workspace/Tweeter/src', '
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tweepy-1.7.1-py2.7.egg', 

'/Applications/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/pydev_sitecustomize', 

'/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages', '/Library/Python/2.7/site-packages', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tweepy-1.7.1-py2.7.egg', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip']
Deepend
  • 4,057
  • 17
  • 60
  • 101

1 Answers1

2

You can place in a folder in your PYTHONPATH.

To know which folders are in your PYTHONPATH you can run this python code

import sys
print sys.path

Also sometimes you can also add packages in your current working directory.

OR put it anywhere (probably you will have to add empty file named __init__.py ) then do this before use,

import sys
sys.path.append('/absolute/path/to/your/tweepyparentdir')
machaku
  • 1,176
  • 8
  • 7
  • Hey, When I printed out the sys.path it looks like I already have Tweepy added to the PythonPath. Two great recommendations though, I’m sure they will help others as well in the future. – Deepend Jun 19 '12 at 13:35