1

It's just a simple program to download timeline tweet,I am calling my keys and then after authentication redirect it to download my tweet.

import tweepy
auth = tweepy.OAuthHandler('My consumer key', 'My consumer secret')
auth.set_access_token('My access token', 'My access token secret')
api = tweepy.API(auth)
public_tweets = api.home_timeline()
for tweet in public_tweets:
    print (tweet.text)

But when I Execute this module, I get Error as:

Traceback (most recent call last):
  File "C:/Python34/tweepy1.py", line 1, in <module>
    import tweepy
  File "C:\Python34\lib\site-packages\tweepy-3.4.0-py3.4.egg\tweepy\__init__.py", line 12, in <module>
    from tweepy.models import Status, User, DirectMessage, Friendship, SavedSearch, SearchResults, ModelFactory, Category
  File "C:\Python34\lib\site-packages\tweepy-3.4.0-py3.4.egg\tweepy\models.py", line 7, in <module>
    from tweepy.utils import parse_datetime, parse_html_value, parse_a_href
  File "C:\Python34\lib\site-packages\tweepy-3.4.0-py3.4.egg\tweepy\utils.py", line 9, in <module>
    import six
ImportError: No module named 'six'

I am really struck , I can't make out where I went wrong . I tried to find about this error but to no avail.

2 Answers 2

1

Seem you don't have the essential six library for tweepy. tweepy does need several dependencies, you can check here for more details.

You can install six using

pip install six

or

easy_install six

or you can download the binary package from Christoph Gohlke's site and install it

http://www.lfd.uci.edu/~gohlke/pythonlibs/#six

Hope it helps.

Sign up to request clarification or add additional context in comments.

4 Comments

@HassanQamar You can check here for more details of using pip. Or you can just press "win+r" and type "cmd" to go to the terminal, and then type the code in my answer.
Just a last question, Tweepy is package , and six is a file, I installed Tweepy through cmd as "setup.py install" , and it worked . But this file I divert cmd directories but it will show error , saying pip is not recongnizable. I know these queries are very basic but I can't help it .
@HassanQamar Both Tweepy and six are python libraries, even through it seems like a file. According to tweepy's requirements, tweepy is built based on six, that's why you need to install six.
Thankyou very much appreciated
0

You must install six in order to use tweepy. Install it using pip as,

pip install six

In case if you are using virtualenv, you can check six is installed or not in virtualenv using ,

pip freeze

2 Comments

Sorry I am new to python, I didn't get exactly how to install six, I downloaded it from Github, a 10kb file , then how to proceed? Help will be really appreciated
Just write to your console as pip install six and press enter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.