【问题标题】:module not found after cloning git repository克隆 git 存储库后找不到模块
【发布时间】:2022-01-19 18:21:20
【问题描述】:

我正在尝试使用这个:https://github.com/google-research/google-research/tree/master/rouge

我已经尝试在 ubuntu for windows 终端中克隆 git 存储库,通过这样做

git clone https://github.com/google-research/google-research.git

克隆似乎很顺利。

但是当我尝试使用这个脚本时:

python3 -m rouge.rouge \
    --target_filepattern="./en_test_CN.txt" \
    --prediction_filepattern="./en_pred_CN.txt" \
    --output_filename="./en_scores.csv" \
    --use_stemmer=true \
    --split_summaries=true

它说没有名为 rouge.rouge 的模块:

/usr/bin/python3: 没有名为 rouge.rouge 的模块

我真的很陌生,我不知道为什么它不起作用。

【问题讨论】:

  • 您在运行之前是否按照说明和cd google-research,还是运行pip install rouge/requirements.txt

标签: python linux shell github


【解决方案1】:

正如 Tim Roberts 所建议的,README 指定从 google-research root 运行该命令。 此外,您应该安装包的依赖项。

我已经设法通过以下步骤使其运行:

  1. git clone https://github.com/google-research/google-research.git --depth=1
  2. cd google-research
  3. pip install -r rouge/requirements.txt
  4. python -m rouge.rouge --help

【讨论】: