shirosaidev / stocksight

Stock market analyzer and predictor using Elasticsearch, Twitter, News headlines and Python natural language processing and sentiment analysis
https://shirosaidev.github.io/stocksight/
Apache License 2.0
2.12k stars 463 forks source link

Might be a stupide question #2

Closed macd2 closed 5 years ago

macd2 commented 5 years ago

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 commented 5 years ago

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

macd2 commented 5 years ago

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 commented 5 years ago

installing elasticsearch with pip just installs the python module to allow communication to elasticsearch server. You need to install and run elasticsearch server as well.

On Thu, Nov 22, 2018 at 5:16 AM macd2 notifications@github.com wrote:

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?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/shirosaidev/stocksight/issues/2#issuecomment-440796376, or mute the thread https://github.com/notifications/unsubscribe-auth/AQomf2CWemtnFA28wI3I0oWA2gM_1fdGks5uxbSvgaJpZM4Yr4CZ .

macd2 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

  2. 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 commented 5 years ago

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 commented 5 years ago

maybe try running without --debug

macd2 commented 5 years ago

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

shirosaidev commented 5 years ago

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 commented 5 years ago

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