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

ores dev_server requires pylru #166

Open
legoktm opened this issue Aug 31, 2016 · 5 comments
Open

ores dev_server requires pylru #166

legoktm opened this issue Aug 31, 2016 · 5 comments

Comments

@legoktm
Copy link
Member

legoktm commented Aug 31, 2016

#110 appears to have regressed.

I did a fresh pip install ores and then ores dev_server and it tells me that:

(venv) km@km-tp ~/p/ores> ores dev_server
2016-08-31 13:19:02,624 INFO:ores.scoring_systems.scoring_system -- Loading ScoreProcessor 'local_single_thread' from config.
2016-08-31 13:19:02,624 INFO:ores.scoring_systems.single_thread -- Loading SingleThread 'local_single_thread' from config.
2016-08-31 13:19:02,625 INFO:ores.scoring_context -- Loading ScoringContext 'testwiki' from config.
2016-08-31 13:19:02,625 WARNING:revscoring.extractors.extractor -- Loading OfflineExtractor.  You probably want an APIExtractor unless this is the test server.
2016-08-31 13:19:02,625 INFO:ores.score_caches.score_cache -- Loading ScoreCache 'memory_lru' from config.
Traceback (most recent call last):
  File "/home/km/projects/ores/venv/lib/python3.5/site-packages/ores/score_caches/lru.py", line 12, in __init__
    import pylru
ImportError: No module named 'pylru'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/km/projects/ores/venv/bin/ores", line 11, in <module>
    sys.exit(main())
  File "/home/km/projects/ores/venv/lib/python3.5/site-packages/ores/ores.py", line 54, in main
    module.main(sys.argv[2:])
  File "/home/km/projects/ores/venv/lib/python3.5/site-packages/ores/utilities/dev_server.py", line 55, in main
    app = server.configure(config)
  File "/home/km/projects/ores/venv/lib/python3.5/site-packages/ores/wsgi/server.py", line 28, in configure
    scoring_system = ScoringSystem.from_config(config, ss_name)
  File "/home/km/projects/ores/venv/lib/python3.5/site-packages/ores/scoring_systems/scoring_system.py", line 322, in from_config
    return Class.from_config(config, name)
  File "/home/km/projects/ores/venv/lib/python3.5/site-packages/ores/scoring_systems/single_thread.py", line 37, in from_config
    config, name, section_key=section_key)
  File "/home/km/projects/ores/venv/lib/python3.5/site-packages/ores/scoring_systems/scoring_system.py", line 294, in _kwargs_from_config
    score_cache = ScoreCache.from_config(config, section['score_cache'])
  File "/home/km/projects/ores/venv/lib/python3.5/site-packages/ores/score_caches/score_cache.py", line 37, in from_config
    return Class.from_config(config, name)
  File "/home/km/projects/ores/venv/lib/python3.5/site-packages/ores/score_caches/lru.py", line 39, in from_config
    return cls(**{k: v for k, v in section.items() if k != "class"})
  File "/home/km/projects/ores/venv/lib/python3.5/site-packages/ores/score_caches/lru.py", line 15, in __init__
    "required when using ores.score_caches.LRU.")
ImportError: Could not find pylru.  This packages is required when using ores.score_caches.LRU.
@halfak
Copy link
Member

halfak commented Aug 31, 2016

That's because of the way the dev server is configured. If you set it to use no cache, then it won't complain.

@legoktm
Copy link
Member Author

legoktm commented Aug 31, 2016

I'm not sure how to do that...maybe the documentation just needs updating? Currently the steps listed at https://github.com/wiki-ai/ores#installation don't work.

@jonasagx
Copy link

The problem I had running ores dev_server was:

Traceback (most recent call last):
File "/home/jonas/projects/sandbox/ores-test/3.4/bin/ores", line 11, in
sys.exit(main())
File "/home/jonas/projects/sandbox/ores-test/3.4/lib/python3.5/site-packages/ores/ores.py", line 54, in main
module.main(sys.argv[2:])
File "/home/jonas/projects/sandbox/ores-test/3.4/lib/python3.5/site-packages/ores/utilities/dev_server.py", line 33, in main
sorted(glob.glob(config_paths))))
File "/home/jonas/projects/sandbox/ores-test/3.4/lib/python3.5/site-packages/yamlconf/load.py", line 20, in load
doc = merge(*(yaml.load(f) for f in files))
TypeError: merge() missing 1 required positional argument: 'd'

@halfak
Copy link
Member

halfak commented Jan 19, 2017

pip install yamlconf --upgrade
and then try again.

@halfak
Copy link
Member

halfak commented Jan 19, 2017

Oh! Actually, that's fine. The real problem is that there's no config provided. That error should be better. Try ./utility dev_server -h and see the --config option

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