Skip to content

Windows 10 compatibility? #7

Open

Description

@miracleflame

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.

Activity

  1. bodograumann commented on Apr 4, 2022

    @bodograumann
    Owner

    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.

  2. miracleflame commented on Apr 5, 2022

    @miracleflame
    Author

    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.

  3. gotoh commented on Jul 4, 2024

    @gotoh
    Contributor

    I got success to build and use python-iconv with python 3.11 and 3.12 (msvc).

    1. Clone iconv-for-windows and build it with VS2022.
    2. Copy iconv.h into python311\include\, libiconv.lib as libs\iconv.lib, libiconv.dll into lib\site-packages\.
    3. Clone this python-iconv and apply patch in Fix to build on windows #8.
    4. Run 'pip install .` in source tree.
    5. Check 'import iconv' success.
  4. bodograumann commented on Oct 31, 2025

    @bodograumann
    Owner

    Thanks so much for your contribution, @gotoh . I just released it as 1.1.3. Sorry for the delay.

  5. StanFromIreland commented on Nov 1, 2025

    @StanFromIreland
    Contributor

    @bodograumann WDYT about providing Windows (& Mac) wheels?

  6. bodograumann commented on Nov 1, 2025

    @bodograumann
    Owner

    Haven't seen any requests for mac support, but supporting windows would be great I think.
    Not sure what would be involved though. @StanFromIreland

  7. StanFromIreland commented on Nov 1, 2025

    @StanFromIreland
    Contributor

    I can write a release automation, once I figure out how to build it for the tests, it should be simple enough.

  8. bodograumann commented on Dec 12, 2025

    @bodograumann
    Owner

    Can you remind me if there is anything left to do, to publish the mac and windows wheels, @StanFromIreland ?

  9. StanFromIreland commented on Dec 12, 2025

    @StanFromIreland
    Contributor

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions