mattmakai / slack-starterbot

Python-powered simple starter Slack bot.
https://www.fullstackpython.com/blog/build-first-slack-bot-python.html
MIT License
197 stars 146 forks source link

logger issue #14

Open bidyutdeka opened 5 years ago

bidyutdeka commented 5 years ago

I am getting this issue when trying to start the bot

No handlers could be found for logger "slackclient.client" Connection failed. Exception traceback printed above.

condor723 commented 5 years ago

Friend of mine got the same error. He's on pip 18.1 and python 2.7.

Worked for me on pip 10.0.1 and python 3.7.

screen shot 2018-10-13 at 9 40 57 pm

Also had to use: had to use: python3 -m pip install slackclient to install.

bkgoodman commented 5 years ago

I am getting this same error - Python 2.7

crhatton commented 5 years ago

I had the same error on Python 2.7.

Python3 gives more info that helped me diagnose this as SlackLoginError. Some googling turned up this link, which suggests using the "Bot User OAuth Access Token" (the second one).

https://github.com/slackapi/python-slackclient/issues/326

I switched and it's good now.

bkgoodman commented 5 years ago

I did make a hack/fix for Python 2.7 (I can't remember)

It was something like adding logger.basicConfig() right at the top of the client module

crhatton commented 5 years ago

Yep, just confirmed your fix @bkgoodman ... need to:

import logging logging.basicConfig()

to get rid of the log handler error on Python 2.7