Repository: Unbabel/COMET
Issue: [QUESTION] Does COMET work on windows?
Root cause: External Dependency Breakage

COMET installation is failing on windows.  Could you please take a look?
```
(base) C:\>conda create --name comet_windows_3_7 python=3.7
(base) C:\>conda activate comet_windows_3_7
(comet_windows_3_7) C:\>pip install unbabel-comet

Using cached test_tube-0.7.4.tar.gz (21 kB)
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\test\Anaconda3\envs\comet_windows_3_7\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\test\\AppData\\Local\\Temp\\pip-install-68_b6icx\\test-tube_f70f8dd226d64a01b89decde5fae3cab\\setup.py'"'"'; __file__='"'"'C:\\Users\\test\\AppData\\Local\\Temp\\pip-install-68_b6icx\\test-tube_f70f8dd226d64a01b89decde5fae3cab\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\test\AppData\Local\Temp\pip-pip-egg-info-ko3bque_'
         cwd: C:\Users\test\AppData\Local\Temp\pip-install-68_b6icx\test-tube_f70f8dd226d64a01b89decde5fae3cab\
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\test\AppData\Local\Temp\pip-install-68_b6icx\test-tube_f70f8dd226d64a01b89decde5fae3cab\setup.py", line 28, in <module>
        install_requires=load_requirements(PATH_ROOT),
      File "C:\Users\test\AppData\Local\Temp\pip-install-68_b6icx\test-tube_f70f8dd226d64a01b89decde5fae3cab\setup.py", line 10, in load_requirements
        with open(os.path.join(path_dir, 'requirements.txt'), 'r') as file:
    FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\test\\AppData\\Local\\Temp\\pip-install-68_b6icx\\test-tube_f70f8dd226d64a01b89decde5fae3cab\\requirements.txt'


```


Python 3.6 and python 3.8 also gave me similar errors. 

Hey @ranjita-naik! did you installed the latest COMET version ? pip install unbabel-comet==0.1.0?

COMET was not running for windows due to FastBPE package but I removed that dependency on the latest version. I see you are having a problem with test-tube, but I dont think test-tube is a COMET dependency

```
pip install unbabel-comet==0.1.0
```
is also failing with the same error. 

Ok ok, I'll have to create a VM and try to see why it's breaking for windows. 
I'll send you some updates early next week

Actually I got the installation working - used python 3.7 + torch==1.4.0.  Now I'm trying to run it end to end. 

That's good news! is it running well? 

No, it failed with the following error
```
    arg_overrides=kwargs,
  File "c:\program\anaconda3\envs\comet_windows_server_3_7\lib\site-packages\fairseq\checkpoint_utils.py", line 194, in load_model_ensemble_and_task
    task = tasks.setup_task(args)
  File "c:\program\anaconda3\envs\comet_windows_server_3_7\lib\site-packages\fairseq\tasks\__init__.py", line 17, in setup_task
    return TASK_REGISTRY[args.task].setup_task(args, **kwargs)
  File "c:\program\anaconda3\envs\comet_windows_server_3_7\lib\site-packages\fairseq\tasks\multilingual_masked_lm.py", line 74, in setup_task
    dictionary = Dictionary.load(os.path.join(paths[0], 'dict.txt'))
  File "c:\program\anaconda3\envs\comet_windows_server_3_7\lib\site-packages\fairseq\data\dictionary.py", line 188, in load
    d.add_from_file(f)
  File "c:\program\anaconda3\envs\comet_windows_server_3_7\lib\site-packages\fairseq\data\dictionary.py", line 201, in add_from_file
    raise fnfe
  File "c:\program\anaconda3\envs\comet_windows_server_3_7\lib\site-packages\fairseq\data\dictionary.py", line 198, in add_from_file
    with open(f, 'r', encoding='utf-8') as fd:
FileNotFoundError: [Errno 2] No such file or directory: 'C\\dict.txt'
```

Ok that's a known error from fairseq: [fairseq issue #865](https://github.com/pytorch/fairseq/issues/865)

I'll allocate some time next week to look at it. Probably you have to install fairseq locally and change the logic behind path splitting convention

fairseq==0.10.0 doesn't have this problem but COMET depends on 0.9.0.  After I fixed the path splitting logic in the locally installed version of fairseq==0.9.0, COMET ran fine. I also managed to create an exe through pyinstaller. 

@ranjita-naik what did you do to get it working? I'm also having problems getting it installed on windows.

@lodeous  the following worked for me.

```
conda create --name comet_windows_3_7 python=3.7
conda activate comet_windows_3_7
pip install torch==1.4.0 -f https://download.pytorch.org/whl/torch_stable.html
pip install unbabel-comet==0.1.0 torch==1.4.0
```

I was able to build from the source as well; had to add torch==1.4.0 to poetry. 
```
poetry add https://download.pytorch.org/whl/cu92/torch-1.4.0%2Bcu92-cp37-cp37m-win_amd64.whl

```

If the above doesn't work, do share the errors, I can take a look. 

@ranjita-naik Thanks for helping out 🙏