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

Might be a stupide question #2

Closed
macd2 opened this issue Nov 20, 2018 · 11 comments
Closed

Might be a stupide question #2

macd2 opened this issue Nov 20, 2018 · 11 comments

Comments

@macd2
Copy link

macd2 commented Nov 20, 2018

im just trying to get this repo to run i cant get passt this error:

elasticsearch5.exceptions.ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at 0x7f6f35d0eb38>: Failed to establish a new connection: [Errno 111] Connection refused) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7f6f35d0eb38>: Failed to establish a new connection: [Errno 111] Connection refused)

caused by:

2018-11-20 15:26:36,085 [INFO][stocksight] Creating new Elasticsearch index or using existing stocksight
2018-11-20 15:26:36,087 [WARNING][elasticsearch] PUT http://localhost:9200/stocksight [status:N/A request:0.001s]
```
i also tried to configure elastic in the call but no luck.

Any suggestions? 
@shirosaidev
Copy link
Owner

check elasticsearch 5 is running on localhost port 9200, same host you are running stocksight on

@macd2
Copy link
Author

macd2 commented Nov 21, 2018

im running pip elasticsearch locally in a VM so it should work without further configuration right,
but i always get the same error even when passing the host and port number here

# create instance of elasticsearch
es = Elasticsearch()`

any other idea what i could do?

@shirosaidev
Copy link
Owner

shirosaidev commented Nov 22, 2018 via email

@macd2
Copy link
Author

macd2 commented Nov 22, 2018

alright thanks for the help. Would you mind to provide a requirements.txt?

By the way i also noticed an other "bug" when using your example command
python sentiment.py -k TSLA,'Elon Musk',Musk,Tesla --debug
you get:

unrecognized argument: Musk','Musk' ,

i figured it has to do with the whitespace here 'Elon Musk',

@shirosaidev
Copy link
Owner

added requirements.txt
I don't get that unrecognized argument error on python 2.7.15 or 3.6.5, which version are you using? Could also be your shell, are you using bash? If you get an error try to use double quotes or escape spaces with a backslash.

@macd2
Copy link
Author

macd2 commented Nov 23, 2018

thanks a lot for the requiremetns.txt
now the unrecognized error is gone but i found 2 other problems:

  1. when creating the twitteruserids.txt the results looks like this:
b'3454353543'
b'4534534535'
b'123213213'
b'1212321312'

this causes and error when running python sentiment.py -f twitteruserids.txt --debug

  1. when running python sentiment.py -k TSLA,'Elon Musk',Musk,Tesla --debug
    and the machine is not fast enough to process all incoming tweets the program breaks. Here a buffer or a try and sleep() would be quite helpful in the loop

@shirosaidev
Copy link
Owner

please use Python 3., I'm testing with 3.6.5
delete twitteruderids.txt and try to run again with Python 3 to re-create file.
I'm testing on a 2013 macbook pro and it's fast enough to run, what hardware are you running on? Is there a traceback error in Python when running that causes the "program to break" ?

@shirosaidev
Copy link
Owner

maybe try running without --debug

@macd2
Copy link
Author

macd2 commented Dec 5, 2018

Hey man sorry for late replay,
so i did the recreation many times with the same result im running python 3.6
ill post the stacktrace soon

macd2 added a commit to macd2/stocksight that referenced this issue Dec 31, 2018
solving the issue described here:
shirosaidev#2
@shirosaidev
Copy link
Owner

on my Mac running python 3.6.5 I don't get the b'' (byte type) for each line printed to the twitteruserids.txt. What os are you using?

@shirosaidev
Copy link
Owner

some patches in latest v0.1-b.5, please test and let me know if fixed now

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

2 participants