bernardopires / twitch-chat-logger

A simple app for logging twitch's chat to a PostgreSQL database.
MIT License
60 stars 14 forks source link

starting problem #3

Open davidex720 opened 8 years ago

davidex720 commented 8 years ago

when i start the program with python main.py it gives me this error:

Traceback (most recent call last): File "main.py", line 3, in from manager import TwitchManager File "/home/davide/twitch-chat-logger/manager.py", line 5, in from irc import run_bot, IRCConnection ImportError: No module named irc

bernardopires commented 8 years ago

Hi,

did you install the dependencies with pip install -r requirements.txt?

davidex720 commented 8 years ago

just done and it gives me this error: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ys4alA/psycopg2

bernardopires commented 8 years ago

Can you try this?

http://stackoverflow.com/questions/17886647/cant-install-via-pip-because-of-egg-info-error

davidex720 commented 8 years ago

just done all the above and even

apt-get install libpq-dev python-dev

but at given: python main.py -n 50 -f log.txt

it gives me this error: Traceback (most recent call last): File "main.py", line 24, in main() File "main.py", line 16, in main manager = TwitchManager(channels_amount=args.channels_amount, channels=args.channels, log_filename=args.log_filename) File "/home/davide/twitch-chat-logger/manager.py", line 28, in init settings.DATABASE['PASSWORD']) File "/home/davide/twitch-chat-logger/db_logger.py", line 11, in init self.conn = psycopg2.connect(host=host, dbname=name, user=user, password=password) File "/usr/local/lib/python2.7/dist-packages/psycopg2/init.py", line 164, in connect conn = _connect(dsn, connection_factory=connection_factory, async=async) psycopg2.OperationalError: could not translate host name "db" to address: Name or service not known

bernardopires commented 8 years ago

Did you read the documentation? If you're not using fig you have to change settings.py, HOST should be localhost, etc

davidex720 commented 8 years ago

i used fig

bernardopires commented 8 years ago

How are you using fig if you said you ran python main.py -n 50 -f log.txt? fig automatically runs python main.py for you

davidex720 commented 8 years ago

cd /home/davide/twitch-chat-logger fig up

and as usual it gives me the same error Recreating twitchchatlogger_db_1... Recreating twitchchatlogger_bot_1... Attaching to twitchchatlogger_db_1, twitchchatlogger_bot_1 db_1 | LOG: database system was shut down at 2016-02-26 09:06:52 UTC db_1 | LOG: MultiXact member wraparound protections are now enabled db_1 | LOG: database system is ready to accept connections db_1 | LOG: autovacuum launcher started bot_1 | Traceback (most recent call last): bot_1 | File "main.py", line 24, in bot_1 | main() bot_1 | File "main.py", line 16, in main bot_1 | manager = TwitchManager(channels_amount=args.channels_amount, channels=args.channels, log_filename=args.log_filename) bot_1 | File "/code/manager.py", line 28, in init bot_1 | settings.DATABASE['PASSWORD']) bot_1 | File "/code/db_logger.py", line 11, in init bot_1 | self.conn = psycopg2.connect(host=host, dbname=name, user=user, password=password) bot_1 | File "/usr/local/lib/python2.7/site-packages/psycopg2/init.py", line 164, in connect bot_1 | conn = _connect(dsn, connection_factory=connection_factory, async=async) bot_1 | psycopg2.OperationalError: could not connect to server: Connection refused bot_1 | Is the server running on host "db" (172.17.0.2) and accepting bot_1 | TCP/IP connections on port 5432? bot_1 | twitchchatlogger_bot_1 exited with code 1 Gracefully stopping... (press Ctrl+C again to force) Stopping twitchchatlogger_db_1... Exception in thread Thread-1 (most likely raised during interpreter shutdown):da

davidex720 commented 8 years ago

didi you get any solution to this?

bernardopires commented 8 years ago

I can not reproduce your error.

juanpflores commented 7 years ago

It looks like you didn't have postgresql installed which is used to install psycopg. I ran into the same problem while getting started. Check the guides to install it depending on your OS.

For Max users:

brew install postgresqlthen pip install -r requirements.txt

Hope this works for you too.