Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named 'twitter_client' #10

Open
MarieFrantz opened this issue Jun 14, 2018 · 5 comments
Open

ImportError: No module named 'twitter_client' #10

MarieFrantz opened this issue Jun 14, 2018 · 5 comments

Comments

@MarieFrantz
Copy link

Hello,
I know someone else brought up this issue, but I can't tell that is was resolved. I am running the code provided with the book, and continue to get this message when attempting to retrieve tweets from the timeline. I'm using python 3.6. Your assistance is much appreciated. Thank you.

@bonzanini
Copy link
Owner

Could you please clarify which script you're trying to run, and how you're running it? (exact sequence of commands)

@MarieFrantz
Copy link
Author

MarieFrantz commented Jun 18, 2018 via email

@bonzanini
Copy link
Owner

The error says that the module twitter_client is not found: this is the file twitter_client.py that you can find in the folder Chap02-03. This file has to be in the same folder as the code you're trying to run so the import can run correctly.

Another problem is that the code is designed to run as a command-line script (i.e. from a terminal):

# make sure you're in the correct folder first
cd Chap02-03
# run the script from the command line
python twitter_streaming.py [your search keywords here]

This will open the streaming and download tweets into a file stream_[your keywords].jsonl, it will keep streaming until you kill the process. If you run this code from a notebook, the notebook will hang while the *.jsonl file is being created. I'd suggest you run the streaming script from the command-line as intended, and then you can run all the analysis scripts from a jupyter notebook once the file *.jsonl is created.

@MarieFrantz
Copy link
Author

MarieFrantz commented Jun 19, 2018 via email

@divyajyothii
Copy link

Hello,

I am getting the "TWITTER_* environment variables not set" exception even though the variables are correct. Could you please help me with this?

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants