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

starting problem #3

Open
davidex720 opened this issue Feb 26, 2016 · 11 comments
Open

starting problem #3

davidex720 opened this issue Feb 26, 2016 · 11 comments

Comments

@davidex720
Copy link

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
Copy link
Owner

Hi,

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

@davidex720
Copy link
Author

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
Copy link
Owner

@davidex720
Copy link
Author

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
Copy link
Owner

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

@davidex720
Copy link
Author

i used fig

@bernardopires
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

didi you get any solution to this?

@bernardopires
Copy link
Owner

I can not reproduce your error.

@juanpflores
Copy link
Contributor

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.

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