r9y9 / pyopenjtalk

Python wrapper for OpenJTalk
https://r9y9.github.io/pyopenjtalk/
Other
202 stars 68 forks source link

PIP install build error #30

Closed alpkabac closed 1 year ago

alpkabac commented 2 years ago

I keep getting this error while trying to install to WSL. I have numpy and other requirements.

` note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for numpy Failed to build numpy ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.`

2000calories commented 2 years ago

I was having the same issue. Here is what works for me. In pyproject.toml, change numpy<v1.20.0 to numpy>=v1.21.5. Then build the package locally.

daogework commented 2 years ago

I had the same problem: "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.32.31326\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -DDIC_VERSION=102 -DMECAB_DEFAULT_RC="dummy" -DPACKAGE="open_jtalk" -DVERSION="1.10" -DCHARSET_UTF_8 -IC:\Users\ADMINI~1\AppData\Local\Temp\pip-build-env-d30lyddm\overlay\Lib\site-packages\numpy\core\include -IH:\pyopenjtalk\lib\open_jtalk\src\jpcommon -IH:\pyopenjtalk\lib\open_jtalk\src\mecab/src -IH:\pyopenjtalk\lib\open_jtalk\src\mecab2njd -IH:\pyopenjtalk\lib\open_jtalk\src\njd -IH:\pyopenjtalk\lib\open_jtalk\src\njd2jpcommon -IH:\pyopenjtalk\lib\open_jtalk\src\njd_set_accent_phrase -IH:\pyopenjtalk\lib\open_jtalk\src\njd_set_accent_type -IH:\pyopenjtalk\lib\open_jtalk\src\njd_set_digit -IH:\pyopenjtalk\lib\open_jtalk\src\njd_set_long_vowel -IH:\pyopenjtalk\lib\open_jtalk\src\njd_set_pronunciation -IH:\pyopenjtalk\lib\open_jtalk\src\njd_set_unvoiced_vowel -IH:\pyopenjtalk\lib\open_jtalk\src\text2mecab -IC:\Users\Administrator.conda\envs\py37tf\include -IC:\Users\Administrator.conda\envs\py37tf\include "-IC:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.32.31326\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.32.31326\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-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\shared" "-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\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /Tplib\open_jtalk\src\mecab/src\utils.cpp /Fobuild\temp.win-amd64-3.7\Release\lib\open_jtalk\src\mecab/src\utils.obj /source-charset:utf-8 /execution-charset:utf-8 utils.cpp lib\open_jtalk\src\mecab/src\utils.cpp(60): fatal error C1083: 无法打开包括文件: “dirent.h”: No such file or directory setup.py:26: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. _CYTHON_INSTALLED = ver >= LooseVersion(min_cython_ver) error: command 'C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.32.31326\bin\HostX86\x64\cl.exe' failed with exit code 2 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pyopenjtalk Failed to build pyopenjtalk ERROR: Could not build wheels for pyopenjtalk, which is required to install pyproject.toml-based projects

My environment:

Windows 10 (x64) Visual Studio 2022

jpcorb20 commented 1 year ago

Hi,

I have the same issue, is there any solution?

Thanks

Mo-to commented 1 year ago

I am facing the same issue. Tested environments:

I also tried using both the pip cmake and the Cmake windows installer. All systems are 64-bit. Furthermore, I tried using this PR: https://github.com/r9y9/pyopenjtalk/pull/13 on windows, but it also failed.

I feel like this error is connected to missing VSCode requirements, but for me it even fails after installing all of them.

CodeDog04 commented 1 year ago

I was having this issue. For anyone still having this issue on windows be sure to add cmake to your environment variables. Likely that it's not able to get requirements to build wheel which needs to know where C++. Good luck!
`STEP1: Go to the Visual Studio download page and install Visual Studio but be sure to install the darn C++ libraries. Otherwise:

STEP2: Scroll down to "All Downloads" and click on "Tools for Visual Studio 2022"

STEP3: Click on "Build Tools for Visual Studio 2022"

STEP4: On the "Build Tools for Visual Studio 2022" page, click on "Download"

STEP5: Run the installer and select the "C++ build tools" component during installation

STEP6: Start a new C++ cmake project to find where cmake is installed. Example: "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe"

STEP7: System Properties -> Environmental Variables -> System Variables -> click on variable name path -> click on Edit and add the "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin" Be sure not to keep the cmake.exe in path ` Good luck! I hope this helps someone.

acoreq commented 1 year ago

i got the same issue, is your issue fixed? if so, would share the practice? thx

I had the same problem: "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.32.31326\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -DDIC_VERSION=102 -DMECAB_DEFAULT_RC="dummy" -DPACKAGE="open_jtalk" -DVERSION="1.10" -DCHARSET_UTF_8 -IC:\Users\ADMINI~1\AppData\Local\Temp\pip-build-env-d30lyddm\overlay\Lib\site-packages\numpy\core\include -IH:\pyopenjtalk\lib\open_jtalk\src\jpcommon -IH:\pyopenjtalk\lib\open_jtalk\src\mecab/src -IH:\pyopenjtalk\lib\open_jtalk\src\mecab2njd -IH:\pyopenjtalk\lib\open_jtalk\src\njd -IH:\pyopenjtalk\lib\open_jtalk\src\njd2jpcommon -IH:\pyopenjtalk\lib\open_jtalk\src\njd_set_accent_phrase -IH:\pyopenjtalk\lib\open_jtalk\src\njd_set_accent_type -IH:\pyopenjtalk\lib\open_jtalk\src\njd_set_digit -IH:\pyopenjtalk\lib\open_jtalk\src\njd_set_long_vowel -IH:\pyopenjtalk\lib\open_jtalk\src\njd_set_pronunciation -IH:\pyopenjtalk\lib\open_jtalk\src\njd_set_unvoiced_vowel -IH:\pyopenjtalk\lib\open_jtalk\src\text2mecab -IC:\Users\Administrator.conda\envs\py37tf\include -IC:\Users\Administrator.conda\envs\py37tf\include "-IC:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.32.31326\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.32.31326\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-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\shared" "-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\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /Tplib\open_jtalk\src\mecab/src\utils.cpp /Fobuild\temp.win-amd64-3.7\Release\lib\open_jtalk\src\mecab/src\utils.obj /source-charset:utf-8 /execution-charset:utf-8 utils.cpp lib\open_jtalk\src\mecab/src\utils.cpp(60): fatal error C1083: 无法打开包括文件: “dirent.h”: No such file or directory setup.py:26: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. _CYTHON_INSTALLED = ver >= LooseVersion(min_cython_ver) error: command 'C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.32.31326\bin\HostX86\x64\cl.exe' failed with exit code 2 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pyopenjtalk Failed to build pyopenjtalk ERROR: Could not build wheels for pyopenjtalk, which is required to install pyproject.toml-based projects

My environment:

Windows 10 (x64) Visual Studio 2022