Keine Konfigurationen für Inline -Läufer: MRJOB -Fehler angegebenPython

Python-Programme
Anonymous
 Keine Konfigurationen für Inline -Läufer: MRJOB -Fehler angegeben

Post by Anonymous »

Ich bin also ziemlich neu bei MRJOB, also sei bitte nicht unhöflich. < /p>
Ich habe versucht in 3 Textdateien; Ich erhalte jedoch immer den gleichen Fehler: "Keine Konfigurationen für Inline -Läufer", kann jemand bitte erklären, was das Problem ist, da Googleing nicht geholfen hat.
Code:

Code: Select all

from mrjob.job import MRJob
import math
import os
import re

WORD_RE = re.compile(r"\b\w+\b")

class TFIDFJob(MRJob):

def configure_args(self):
super(TFIDFJob, self).configure_args()
self.add_passthru_arg('--query', type=str, help='Search query')

def mapper(self, _, line):
file_name, content = line.split("\t", 1)
words = WORD_RE.findall(content.lower())
total_words = len(words)

for word in words:
yield (word, file_name), 1

yield ("__TOTAL__", file_name), total_words

def reducer(self, key, values):
if key[0] == "__TOTAL__":
yield key[1], sum(values)
else:
word, file_name = key
word_count = sum(values)
yield (file_name, word), word_count

if __name__ == "__main__":
search_query = input("Enter query: ")

files = []
for file_name in ["file1.txt", "file2.txt", "file3.txt"]:
with open(file_name, 'r', encoding='utf-8') as f:
files.append((file_name, f.read()))

job = TFIDFJob(args=['--query', search_query])
with job.make_runner() as runner:
runner.run()
for key, value in job.parse_output(runner.cat_output()):
print(f"{key}: {value}")
< /code>
und der Fehler, den ich erhalte: < /p>
$ python3 hw1.py file1.txt file2.txt file3.txt
Enter query: 123
No configs specified for inline runner
^CTraceback (most recent call last):
File "/home/dh/xd/hw/hw1.py", line 42, in 
runner.run()
File "/home/dh/.local/lib/python3.11/site-packages/mrjob/runner.py", line 503, in run
self._run()
File "/home/dh/.local/lib/python3.11/site-packages/mrjob/sim.py", line 161, in _run
self._run_step(step, step_num)
File "/home/dh/.local/lib/python3.11/site-packages/mrjob/sim.py", line 170, in _run_step
self._run_streaming_step(step, step_num)
File "/home/dh/.local/lib/python3.11/site-packages/mrjob/sim.py", line 179, in _run_streaming_step
self._input_paths_for_step(step_num), step_num)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dh/.local/lib/python3.11/site-packages/mrjob/sim.py", line 594, in _input_paths_for_step
for input_path_glob in self._get_input_paths()
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dh/.local/lib/python3.11/site-packages/mrjob/runner.py", line 1083, in _get_input_paths
for line in self._stdin:
KeyboardInterrupt
Vielen Dank vor Ihnen im Voraus.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post