Question

I don't know what I'm doing wrong here:

Sun Oct 14$ pip install python-twitter
Requirement already satisfied (use --upgrade to upgrade): python-twitter in /Library/Python/2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): setuptools in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from python-twitter)
Requirement already satisfied (use --upgrade to upgrade): simplejson in /Library/Python/2.7/site-packages (from python-twitter)
Requirement already satisfied (use --upgrade to upgrade): oauth2 in /Library/Python/2.7/site-packages (from python-twitter)
Requirement already satisfied (use --upgrade to upgrade): httplib2 in /Library/Python/2.7/site-packages (from oauth2->python-twitter)
Cleaning up...
Sun Oct 14$ python
Python 2.7.2 (default, Nov 17 2011, 13:22:48) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import twitter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named twitter
>>> 

Do I need to do a virtualenv? What else could be going on? Sorry for my lack of understanding but any help is appreciated.

edit #1 trying to get tweepy working but.... possibly might have two versions of Python 2.7 here

Sun Oct 14$ pip install --upgrade tweepy
Requirement already up-to-date: tweepy in ./tweepy-1.11-py2.7.egg
Cleaning up...
Sun Oct 14$ python
Python 2.7.2 (default, Nov 17 2011, 13:22:48) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tweepy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named tweepy
>>> 

I think I might have two versions of Python 2.7 installed; one via homebrew and the Apple default. Is it possible that the homebrew install would put packages in /Library/Python/2.7/site-packages?

again, thx in advance

Was it helpful?

Solution

From what I've read, python-twitter:

Relies on Basic-Auth which Twitter switched off sometime between August and September (2010). Only OAuth is supported by the API, and python-twitter doesn't support this.

UPDATE: I just tried installing python-twitter using the exact same method you used and I am unable to import it as well. After doing some research I came across Python Twitter Tools, which I believe is python-twitter's replacement.

Installing twitter requires setuptools. It's just easy_install twitter to install it from the web.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top