Jefferson-Henrique / GetOldTweets-python

A project written in Python to get old tweets, it bypass some limitations of Twitter Official API.
MIT License
1.35k stars 808 forks source link

Not working in Jupyter notebook #198

Open jamesozden opened 6 years ago

jamesozden commented 6 years ago

This is probably an extremely simple issue but I seem to be stuck.

I've run GetOldTweets in my command line and it works fine, however when I run it in a Jupyter notebook I encounter this error:

name 'got' is not defined

I clearly need to import something however I'm not sure exactly what... any help would be much appreciated, thank you!

vdnhu commented 6 years ago

Hi, I have the same problem. When I try to import the files I get an error saying: ModuleNotFoundError Traceback (most recent call last)

in () ----> 1 from Documents import got ModuleNotFoundError: No module named 'Documents' Any help would be great (I am just a beginner and want to use historical tweets for my thesis, however this code is a bit advanced for me) Thanks in advance!
rahulha commented 6 years ago

I see @vdnhu other query so I prefer to answer both comments here. First Jupyter notebook works different than Python console. each notebook has its own Kernel that imports all libraries and files. You need to import entire getoldtwees folder to Jupyter. Then open Exporter.py and run it.

Since Exporter.py is a python file, Jupyter will not let you run it as is. You need to create a new notebook file (.ipynb), copy Exporter.py code there and then run it.

If you have latest Anaconda, you are likely to have Python 3.x so you can skip got folder and just use got3.