1ytic / pytorch-edit-distance

Levenshtein edit-distance on PyTorch and CUDA
MIT License
94 stars 14 forks source link

cannot be installed with the cpu only version of torch #9

Closed guillaumeBellec closed 3 years ago

guillaumeBellec commented 3 years ago

The pip command below fails in a conda environment with torch 1.9, cpu only. pip install torch_edit_distance

Full error message:


     command: /home/bellec/miniconda3/envs/music-ai/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8o4v0pgz/torch-edit-distance/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8o4v0pgz/torch-edit-distance/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 /tmp/pip-pip-egg-info-4mwan4wc
         cwd: /tmp/pip-install-8o4v0pgz/torch-edit-distance/
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-8o4v0pgz/torch-edit-distance/setup.py", line 36, in <module>
        'edit-distance.cu',
      File "/home/bellec/miniconda3/envs/music-ai/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 868, in CUDAExtension
        library_dirs += library_paths(cuda=True)
      File "/home/bellec/miniconda3/envs/music-ai/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 976, in library_paths
        if (not os.path.exists(_join_cuda_home(lib_dir)) and
      File "/home/bellec/miniconda3/envs/music-ai/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1984, in _join_cuda_home
        raise EnvironmentError('CUDA_HOME environment variable is not set. '
    OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.```
1ytic commented 3 years ago

True, this package is only implemented for pytorch with cuda.