r4victor / afaligner

📈 A forced aligner intended for synchronization of narrated text
MIT License
85 stars 11 forks source link

error about `C++ Compiler` when `pip install afaligner` #6

Closed scillidan closed 1 year ago

scillidan commented 2 years ago

Guys, I want install syncabook on Window10. I used the python 3.7.4, a special version that from install the aeneas, refer to https://github.com/readbeyond/aeneas/blob/master/wiki/INSTALL.md. Only success install it when use this version. Run errors when use python37, python39, and winpython374(https://winpython.github.io/). I do not install the miniconda (Python 2.7.x), I get some search-results, seems needed to build it by self. This method is too difficult for me. And the Microsoft Visual C++ Compiler for Python, because the link is broken. Finally, seems aeneas successfully installed.

When install afaligner, it say:

D:\home λ C:\Python37-32\python.exe -m pip install afaligner
Collecting afaligner
  Using cached https://files.pythonhosted.org/packages/8d/c1/c010e93bee4d519a7f4416da8d3ad04a4708358d48386419282eab942e4f/afaligner-0.1.8.tar.gz
Requirement already satisfied, skipping upgrade: aeneas==1.7.3.0 in c:\python37-32\lib\site-packages (from afaligner) (1.7.3.0)
Requirement already satisfied, skipping upgrade: Jinja2==2.11.3 in c:\python37-32\lib\site-packages (from afaligner) (2.11.3)
Requirement already satisfied, skipping upgrade: BeautifulSoup4>=4.5.1 in c:\python37-32\lib\site-packages (from aeneas==1.7.3.0->afaligner) (4.8.2)
Requirement already satisfied, skipping upgrade: lxml>=3.6.0 in c:\python37-32\lib\site-packages 
(from aeneas==1.7.3.0->afaligner) (4.6.3)
Requirement already satisfied, skipping upgrade: numpy>=1.9 in c:\python37-32\lib\site-packages (from aeneas==1.7.3.0->afaligner) (1.17.1)
Requirement already satisfied, skipping upgrade: MarkupSafe>=0.23 in c:\python37-32\lib\site-packages (from Jinja2==2.11.3->afaligner) (2.0.1)
Requirement already satisfied, skipping upgrade: soupsieve>=1.2 in c:\python37-32\lib\site-packages (from BeautifulSoup4>=4.5.1->aeneas==1.7.3.0->afaligner) (1.9.3)
Installing collected packages: afaligner
  Running setup.py install for afaligner ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = 
'"'"'C:\\Users\\SCILLI~1\\AppData\\Local\\Temp\\pip-install-a6r08gmi\\afaligner\\setup.py'"'"'; __file__='"'"'C:\\Users\\SCILLI~1\\AppData\\Local\\Temp\\pip-install-a6r08gmi\\afaligner\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\SCILLI~1\AppData\Local\Temp\pip-record-1yztoonj\install-record.txt' --single-version-externally-managed --compile
         cwd: C:\Users\SCILLI~1\AppData\Local\Temp\pip-install-a6r08gmi\afaligner\
    Complete output (38 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.7
    creating build\lib.win32-3.7\afaligner
    copying src\afaligner\c_dtwbd_wrapper.py -> build\lib.win32-3.7\afaligner
    copying src\afaligner\dtwbd.py -> build\lib.win32-3.7\afaligner
    copying src\afaligner\__init__.py -> build\lib.win32-3.7\afaligner
    creating build\lib.win32-3.7\afaligner\templates
    copying src\afaligner\templates\template.smil -> build\lib.win32-3.7\afaligner\templates     
    running build_ext
    building 'afaligner.c_modules.dtwbd' extension
    creating build\temp.win32-3.7
    creating build\temp.win32-3.7\Release
    creating build\temp.win32-3.7\Release\src
    creating build\temp.win32-3.7\Release\src\afaligner
    creating build\temp.win32-3.7\Release\src\afaligner\c_modules
    C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Python37-32\include -IC:\Python37-32\include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsrc/afaligner/c_modules/dtwbd.c /Fobuild\temp.win32-3.7\Release\src/afaligner/c_modules/dtwbd.obj
    dtwbd.c
    src/afaligner/c_modules/dtwbd.c(1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字 
符。请将该文件保存为 Unicode 格式以防止数据丢失
    src/afaligner/c_modules/dtwbd.c(41): warning C4142: "FastDTWBD": 类型的良性重定义
    src/afaligner/c_modules/dtwbd.c(12): note: 参见“FastDTWBD”的声明
    src/afaligner/c_modules/dtwbd.c(31): warning C4273: “FastDTWBD”: dll 链接不一致
    src/afaligner/c_modules/dtwbd.c(12): note: 参见“FastDTWBD”的前一个定义
    src/afaligner/c_modules/dtwbd.c(74): warning C4142: "DTWBD": 类型的良性重定义
    src/afaligner/c_modules/dtwbd.c(13): note: 参见“DTWBD”的声明
    src/afaligner/c_modules/dtwbd.c(63): warning C4273: “DTWBD”: dll 链接不一致
    src/afaligner/c_modules/dtwbd.c(13): note: 参见“DTWBD”的前一个定义
    src/afaligner/c_modules/dtwbd.c(173): warning C4018: “>=”: 有符号/无符号不匹配
    src/afaligner/c_modules/dtwbd.c(178): warning C4018: “>”: 有符号/无符号不匹配
    src/afaligner/c_modules/dtwbd.c(181): warning C4018: “<”: 有符号/无符号不匹配
    src/afaligner/c_modules/dtwbd.c(184): warning C4018: “>=”: 有符号/无符号不匹配
    creating C:\Users\SCILLI~1\AppData\Local\Temp\pip-install-a6r08gmi\afaligner\build\lib.win32-3.7\afaligner\c_modules
    C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX86\x86\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Python37-32\libs /LIBPATH:C:\Python37-32\PCbuild\win32 "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\lib\x86" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\lib\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.19041.0\\um\x86" /EXPORT:PyInit_dtwbd build\temp.win32-3.7\Release\src/afaligner/c_modules/dtwbd.obj /OUT:build\lib.win32-3.7\afaligner\c_modules\dtwbd.so /IMPLIB:build\temp.win32-3.7\Release\src/afaligner/c_modules\dtwbd.lib
    LINK : error LNK2001: 无法解析的外部符号 PyInit_dtwbd
    build\temp.win32-3.7\Release\src/afaligner/c_modules\dtwbd.lib : fatal error LNK1120: 1 个无 
法解析的外部命令
    error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX86\\x86\\link.exe' failed with exit status 1120
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\SCILLI~1\\AppData\\Local\\Temp\\pip-install-a6r08gmi\\afaligner\\setup.py'"'"'; __file__='"'"'C:\\Users\\SCILLI~1\\AppData\\Local\\Temp\\pip-install-a6r08gmi\\afaligner\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\SCILLI~1\AppData\Local\Temp\pip-record-1yztoonj\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

Something I installed in Visual Studio Community 2022. image

I try to use docker, but I found I couldn't build it. Seems because of the bad network in my home :(

sharinganthief commented 1 year ago

bump