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

how to run a test? #5

Open
samuel281 opened this issue Apr 10, 2013 · 7 comments
Open

how to run a test? #5

samuel281 opened this issue Apr 10, 2013 · 7 comments

Comments

@samuel281
Copy link

Hello I'm so interedted in this solution.

After installing r3 via easy install I tried to run the test code.

git clone https://github.com/heynemann/r3.git
cd r3/test
r3-app --redis-port 6379 -c app_config.py

but there's importError

Traceback (most recent call last):
  File "/usr/bin/r3-app", line 9, in <module>
    load_entry_point('r3==0.2.0', 'console_scripts', 'r3-app')()
  File "/usr/lib/python2.6/site-packages/r3-0.2.0-py2.6.egg/r3/app/server.py", line 39, in main
    application = R3ServiceApp(redis=c, config=cfg, log_level=args.loglevel.upper(), debug=args.debug, show_index_page=not args.hide_index_page)
  File "/usr/lib/python2.6/site-packages/r3-0.2.0-py2.6.egg/r3/app/app.py", line 35, in __init__
    self.load_input_streams()
  File "/usr/lib/python2.6/site-packages/r3-0.2.0-py2.6.egg/r3/app/app.py", line 45, in load_input_streams
    stream = kls_import(stream_class)
  File "/usr/lib/python2.6/site-packages/r3-0.2.0-py2.6.egg/r3/app/utils.py", line 37, in kls_import
    module = reduce(getattr, module_parts[1:], __import__('.'.join(module_parts)))
ImportError: No module named count_words_stream

Is there something I've missed?

ps. python version is 2.6.6 on centos 6.2
thanks

@MOON-CLJ
Copy link

PYTHONPATH=. r3-app --redis-port 6379 -c app_config.py

@MOON-CLJ
Copy link

also delete the "test" prefix in app_config.py

@MOON-CLJ
Copy link

oh, Unfortunately,another error happend when i visited http://localhost:9999. so i don't think this project is ready to work. but its idea is cool.

@samuel281
Copy link
Author

I also think so.
thanks for your help

@larrycai
Copy link

it works for me, we need to run the mapper in advance.

PYTHONPATH=. r3-map --mapper-key=mapper-1 --mapper-class="test.count_words_mapper.CountWordsMapper" &

env: Ubuntu 12.04/Python 2.7

@anees042
Copy link

Works:
PYTHONPATH=. r3-map --redis-port=7000 --mapper-key=mapper-1 --mapper-class="count_words_mapper.CountWordsMapper" &

Not Working:
PYTHONPATH=. r3-app --redis-port=7000 -c app_config.py
Traceback (most recent call last):
File "/usr/local/bin/r3-app", line 9, in
load_entry_point('r3==0.2.0', 'console_scripts', 'r3-app')()
File "/usr/local/lib/python2.7/dist-packages/r3/app/server.py", line 39, in main
application = R3ServiceApp(redis=c, config=cfg, log_level=args.loglevel.upper(), debug=args.debug, show_index_page=not args.hide_index_page)
File "/usr/local/lib/python2.7/dist-packages/r3/app/app.py", line 35, in init
self.load_input_streams()
File "/usr/local/lib/python2.7/dist-packages/r3/app/app.py", line 45, in load_input_streams
stream = kls_import(stream_class)
File "/usr/local/lib/python2.7/dist-packages/r3/app/utils.py", line 37, in kls_import
module = reduce(getattr, module_parts[1:], import('.'.join(module_parts)))
ImportError: No module named count_words_stream

@heynemann
Copy link
Owner

It tried to import a module count_words_stream and it was not found.

Can you import that module?

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

5 participants