Repository navigation
Open
Description
Using Python 3.10 and going
pip install python-iconv
failed with
error: microsoft visual c++ 14.0 or greater is required. get it with "microsoft c++ build tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
After installing the default workload for "Desktop development with C++" via Visual Studio Build Tools the result is different after
pip install python-iconv
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools>pip install python-iconv
Defaulting to user installation because normal site-packages is not writeable
Collecting python-iconv
Using cached python-iconv-1.1.2.tar.gz (17 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: python-iconv
Building wheel for python-iconv (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-3.10
copying iconvcodec.py -> build\lib.win32-3.10
running build_ext
building 'iconv' extension
creating build\temp.win32-3.10
creating build\temp.win32-3.10\Release
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Program Files\Python310\include -IC:\Program Files\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\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\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 -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\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\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 /Tciconvmodule.c /Fobuild\temp.win32-3.10\Release\iconvmodule.obj
iconvmodule.c
iconvmodule.c(1): fatal error C1083: Cannot open include file: 'iconv.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x86\\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 python-iconv
Running setup.py clean for python-iconv
Failed to build python-iconv
Installing collected packages: python-iconv
Running setup.py install for python-iconv ... error
error: subprocess-exited-with-error
× Running setup.py install for python-iconv did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
running install
running build
running build_py
creating build
creating build\lib.win32-3.10
copying iconvcodec.py -> build\lib.win32-3.10
running build_ext
building 'iconv' extension
creating build\temp.win32-3.10
creating build\temp.win32-3.10\Release
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Program Files\Python310\include -IC:\Program Files\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\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\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 -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\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\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 /Tciconvmodule.c /Fobuild\temp.win32-3.10\Release\iconvmodule.obj
iconvmodule.c
iconvmodule.c(1): fatal error C1083: Cannot open include file: 'iconv.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x86\\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: legacy-install-failure
× Encountered error while trying to install package.
╰─> python-iconv
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Metadata
Metadata
Assignees
Labels
No labels
Activity
bodograumann commentedon Apr 4, 2022
This project is only a python binding for the native iconv library.
From what I read, there is a libiconv for windows.
Have you made sure that it is installed and that it can be found by the compiler?
The original python 2 version supported “glibc 2, Solaris, or other Unix variants” and I have not made any additional efforts for wider support. Not sure what exactly is needed to build on windows.
Any contribution in that regard would be welcome of course.
miracleflame commentedon Apr 5, 2022
You are correct, iconv is the library that fails to compile.
I've somehow managed to use GnuWin32 to at least get it work as
os.system("iconv --help")but it doesn't quite work well... I'll pass.
gotoh commentedon Jul 4, 2024
I got success to build and use python-iconv with python 3.11 and 3.12 (msvc).
iconv.hintopython311\include\,libiconv.libaslibs\iconv.lib,libiconv.dllintolib\site-packages\.python-iconvand apply patch in Fix to build on windows #8.bodograumann commentedon Oct 31, 2025
Thanks so much for your contribution, @gotoh . I just released it as 1.1.3. Sorry for the delay.
StanFromIreland commentedon Nov 1, 2025
@bodograumann WDYT about providing Windows (& Mac) wheels?
bodograumann commentedon Nov 1, 2025
Haven't seen any requests for mac support, but supporting windows would be great I think.
Not sure what would be involved though. @StanFromIreland
StanFromIreland commentedon Nov 1, 2025
I can write a release automation, once I figure out how to build it for the tests, it should be simple enough.
bodograumann commentedon Dec 12, 2025
Can you remind me if there is anything left to do, to publish the mac and windows wheels, @StanFromIreland ?
StanFromIreland commentedon Dec 12, 2025
No, you'd want something like this example (you also need to add steps for installing dependencies): https://cibuildwheel.pypa.io/en/v2.16.2/setup/#github-actions