facebookresearch / SimulEval

SimulEval: A General Evaluation Toolkit for Simultaneous Translation
Creative Commons Attribution Share Alike 4.0 International
101 stars 35 forks source link

importlib.metadata.PackageNotFoundError: No package metadata was found for simuleval #37

Closed bhaddow closed 1 year ago

bhaddow commented 1 year ago

Hi

Trying to run the dummy waitk example with Python 3.10 gives the following error:

Traceback (most recent call last):
  File "/home/shared/bhaddow/anaconda3/envs/simul-st-rl/bin/simuleval", line 33, in <module>
    sys.exit(load_entry_point('simuleval', 'console_scripts', 'simuleval')())
  File "/home/shared/bhaddow/anaconda3/envs/simul-st-rl/bin/simuleval", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
  File "/home/shared/bhaddow/anaconda3/envs/simul-st-rl/lib/python3.10/importlib/metadata/__init__.py", line 969, in distribution
    return Distribution.from_name(distribution_name)
  File "/home/shared/bhaddow/anaconda3/envs/simul-st-rl/lib/python3.10/importlib/metadata/__init__.py", line 548, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for simuleval

It works fine for me with Python 3.8

best Barry

bhaddow commented 1 year ago

Hi

Actually, when I use a python3.8 within conda, I get the error above. In a python3.8 virtual environment, it works.

Still checking ...

best Barry

bhaddow commented 1 year ago

In a clean Python 3.8 conda environment, SimulEval works correctly. The problem arises with Python 3.10

bhaddow commented 1 year ago

This is on the iwslt2023 branch, clean checkout.

xutaima commented 1 year ago

Hi @bhaddow Can you try the main branch? BTW did you install from source?

I use python 3.10 it works from me ✓ python --version Python 3.10.10 (test_simuleval) /private/home/xutaima/projects/2022_h2_streaming/SimulEval/examples/quick_start s2s_instructions ✗ 28m

✓ python --version
Python 3.10.10
✓ simuleval --source source.txt --target target.txt --agent agent_with_configs.py --waitk 3 --vocab dict.txt
2023-04-14 13:24:51 | INFO     | simuleval.utils.agent | System will run on device: cpu.
2023-04-14 13:24:51 | INFO     | simuleval.dataloader | Evaluating from text to text.
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 2894.02it/s]
2023-04-14 13:24:51 | INFO     | simuleval.sentence_level_evaluator | Results:
  BLEU  LAAL   AL     AP  DAL  ATD
 1.639   3.0  3.0  0.676  3.0  3.0
bhaddow commented 1 year ago

Hi Xutai

With a clean checkout, and a clean environment, it works fine. I tested both iwslt and main branch.

I suspect my original environment was broken in some way

best Barry