简体   繁体   中英

How can I install CTC-Decode?

I am trying to install CTC-Decode on a windows machine. ( https://github.com/parlance/ctcdecode ) I am executing the following code in Git Bash:

git clone --recursive https://github.com/parlance/ctcdecode.git cd ctcdecode && pip install.

I get the following error:

ERROR: Could not install packages due to an EnvironmentError: [('C:\Users\vtz\ctcdecode\third_party\boost_1_67_0\libs\geometry\doc\html\geometry\reference\spatial_indexes\boost__geometry__index__rtree\rtree_parameters_type_const____indexable_getter_const____value_equal_const____allocator_type_const___.html', 'C:\Users\vtz\AppData\Local\Temp\pip-req-build-tb4918ru\third_party\boost_1_67_0\libs\geometry\doc\html\geometry\reference\spatial_indexes\boost__geometry__index__rtree\rtree_parameters_type_const____indexable_getter_const____value_equal_const____allocator_type_const___.html', "[Errno 2] No such file or directory: 'C:\\Users\\vtz\\AppData\\Local\\Temp\\pip-req-build-tb4918ru\\third_party\\boost_1_67_0\\libs\\geometry\\doc\\html\\geometry\\reference\\spatial_indexes\\boost__geometry__index__rtree\\rtree_parameters_type_const____indexable_getter_const____value_equal_const____allocator_type_const___.html'")]

I had a similar issue installing via pip , but unlike you, the local installation worked in my case. I've added my approach in this related GH issue (I'm copypasting it also below for consistency).

I recognize that this is more of a troubleshooter than a specific answer to your problem. The reason is that the installation script has several hardcoded values, and they may vary greatly among different setups. In fact, if you look at the issue above, many different users have different problems, but all likely stem from the same problem with hardcoded values.

For this reason I'm not sure if it's possible to tell which exact combination works for a given setup without knowing many details about system, dependencies, etc, so hopefully this helps anyone to navigate the issue and find a combination that works. feel free to share it if you manage to make it work, it could be a nice addition to the repo.

Cheers!
Andres


Answer from GH issue:

In my case (Ubuntu 20.04, Python3.7, torch 1.8), pip install also failed but cloning and calling the pip install. inside the repo worked.

To add something to the discussion, you may be interested in checking the setup.py file in this repo, which is basically the installation script.

In it, several compressed libraries are downloaded from here and installed. A possible fix for your problems could be to replace those with other versions more compatible with your setup.

Then the libraries are compiled using a g++ command that you can also find inside setup.py. Another possible fix could be to adapt that command to your setup.

Below is worked for me in google colab:

Now you can import ctcdecode without an error

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM