Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Twitter Python Module

I am trying to install Twitter-Python and I am just not getting it. According to everything I've read this should be easy. I have read all that stuff about easy_install, python setup.py install, command lines, etc, but I just don't get it. I downloaded the "twitter-1.9.4.tar.gz", so I now have the 'twitter-1.9.4' folder in my root 'C:\Python27' and tried running

>>> python setup.py install

in IDLE... and that's not working. I was able to install a module for yahoo finance and all I had to do was put the code in my 'C:\Python27\Lib' folder.

How are these different and is there a REALLY BASIC step-by-step for installing packages?

like image 808
AdrianBoeh Avatar asked May 17 '13 18:05

AdrianBoeh


People also ask

Does twitter run on Python?

You will need to install the Python packages searchtweets to help you connect to the Twitter API, and pandas to create a data frame. You'll create a virtual environment that provides an isolated Python environment to install packages into. You also have the option of using conda if you prefer.

What Python package is best for getting data from twitter?

Tweepy is a Python library for integrating with the Twitter API. Because Tweepy is connected with the Twitter API, you can perform complex queries in addition to scraping tweets.

What is Python twitter?

Tweepy is a popular package in Python used by students, researchers and developers for interacting with the Twitter API. Recently, the version 4.0 of this package was released that supports the Twitter API v2 and the academic research product track.


1 Answers

1) Run CMD as administrator
2) Type this:
set path=%path%;C:\Python27\
3) Download python-twitter, if you haven't already did, this is the link I recommend:
https://code.google.com/p/python-twitter/
4) Download PeaZip in order to extract it:
http://peazip.org/
5) Install PeaZip, go to where you have downloaded python-twitter, right click, extract it with PeaZip.
6) Copy the link to the python-twitter folder after extraction, which should be something like this:
C:\Users\KiDo\Downloads\python-twitter-1.1.tar\dist\python-twitter-1.1
7) Go back to CMD, and type:
cd python-twitter location, or something like this:
cd C:\Users\KiDo\Downloads\python-twitter-1.1.tar\dist\python-twitter-1.1
8) Now type this in CMD:
python setup.py install

And it should work fine, to confirm it open IDLE, and type:

import twitter

Now you MAY get another error, like this:

>>> import twitter Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\twitter.py", line 37, in <module> import requests ImportError: No module named requests

Then you have to do kinda same steps in order to download the module requests.

like image 143
KiDo Avatar answered Sep 19 '22 21:09

KiDo