ores icon indicating copy to clipboard operation
ores copied to clipboard

ores dev_server requires pylru

Open legoktm opened this issue 8 years ago • 5 comments

#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.

legoktm avatar Aug 31 '16 20:08 legoktm

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

halfak avatar Aug 31 '16 20:08 halfak

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.

legoktm avatar Aug 31 '16 23:08 legoktm

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'

jonasagx avatar Jan 19 '17 16:01 jonasagx

pip install yamlconf --upgrade and then try again.

halfak avatar Jan 19 '17 17:01 halfak

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

halfak avatar Jan 19 '17 17:01 halfak