Skip to content

JamSpell installation via pip fails (Windows 11) #133

@DragonCloudBurst

Description

@DragonCloudBurst

I'm attempting to install JamSpell via pip for use with a project that I'm working on at my position as an employee at my university's academic library. I work in the Digital Collections department. For context, we're attempting to improve our OCR process, and we're looking at JamSpell as an option that could spellcheck our OCR processor's output, which commonly produces some erroneous results, especially when it is being run on scans of older documents.

However, despite being able to download Swig 3.0.12's source code, pip fails to install JamSpell. The machine I am using is a Windows 11 PC; I was unable to find any official Swig 3 packages from the Windows package managers that we currently have installed (Cygwin and WinGet. I did notice, however, that Chocolately seems to have a package of this version, which I will attempt to install soon if I can obtain permission to do so...). In an effort to attempt to combat that, I ran the pip install from within the folder where Swig is installed... though I'm not fully up to speed with how pip works, so it's possible that pip isn't picking up on it since I wasn't able to install the older version via pip itself...? I doubt that adding the directory to PYTHONPATH would resolve the issue, since it doesn't contain any actual python files.

As a side note... this could potentially still be an issue with Swig not being properly registered in the machine's PATH variable; since our machines are administrated under our IT department, we occasionally run into issues with more advanced computing tasks.

EDIT to clarify: I did add the directory to PATH.

Regardless, it seems to me that the main issue that we're having stems from JamSpell using an older version of Swig that doesn't appear to be recognized by pip (since I had to download the source code manually from SourceForge).

Do you know of any possible way to get around this? Alternatively, would there be a way to get JamSpell to work with a newer version of Swig?

Apologies if any of this sounds a bit uninformed; I know very little about Swig or C++.

Stack trace:

pip install jamspell
Collecting jamspell
  Using cached jamspell-0.0.12.tar.gz (174 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: jamspell
  Building wheel for jamspell (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for jamspell (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [125 lines of output]
      C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\dist.py:599: SetuptoolsDeprecationWarning: Invalid dash-separated key 'description-file' in 'metadata' (setup.cfg), please use the underscore name 'description_file' instead.
      !!

              ********************************************************************************
              Usage of dash-separated 'description-file' will not be supported in future
              versions. Please use the underscore name 'description_file' instead.
              (Affected: jamspell).

              By 2026-Mar-03, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************

      !!
        opt = self._enforce_underscore(opt, section)
      C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!

              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:

              License :: OSI Approved :: MIT License

              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************

      !!
        self._finalize_license_expression()
      running bdist_wheel
      running build
      running build_ext
      building '_jamspell' extension
      <string>:48: DeprecationWarning: Use shutil.which instead of find_executable
      Traceback (most recent call last):
        File "C:\Users\SPIVEYA23\AppData\Local\Programs\Python\Python313\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module>
          main()
          ~~~~^^
        File "C:\Users\SPIVEYA23\AppData\Local\Programs\Python\Python313\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\SPIVEYA23\AppData\Local\Programs\Python\Python313\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 280, in build_wheel
          return _build_backend().build_wheel(
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
              wheel_directory, config_settings, metadata_directory
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          )
          ^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\build_meta.py", line 435, in build_wheel
          return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\build_meta.py", line 423, in _build
          return self._build_with_temp_dir(
                 ~~~~~~~~~~~~~~~~~~~~~~~~~^
              cmd,
              ^^^^
          ...<3 lines>...
              self._arbitrary_args(config_settings),
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          )
          ^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\build_meta.py", line 404, in _build_with_temp_dir
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\build_meta.py", line 512, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 55, in <module>
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\__init__.py", line 115, in setup
          return distutils.core.setup(**attrs)
                 ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 186, in setup
          return run_commands(dist)
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 202, in run_commands
          dist.run_commands()
          ~~~~~~~~~~~~~~~~~^^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 1002, in run_commands
          self.run_command(cmd)
          ~~~~~~~~~~~~~~~~^^^^^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\dist.py", line 1102, in run_command
          super().run_command(command)
          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 1021, in run_command
          cmd_obj.run()
          ~~~~~~~~~~~^^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\command\bdist_wheel.py", line 370, in run
          self.run_command("build")
          ~~~~~~~~~~~~~~~~^^^^^^^^^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 357, in run_command
          self.distribution.run_command(command)
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\dist.py", line 1102, in run_command
          super().run_command(command)
          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 1021, in run_command
          cmd_obj.run()
          ~~~~~~~~~~~^^
        File "<string>", line 37, in run
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 357, in run_command
          self.distribution.run_command(command)
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\dist.py", line 1102, in run_command
          super().run_command(command)
          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 1021, in run_command
          cmd_obj.run()
          ~~~~~~~~~~~^^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 368, in run
          self.build_extensions()
          ~~~~~~~~~~~~~~~~~~~~~^^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 484, in build_extensions
          self._build_extensions_serial()
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 510, in _build_extensions_serial
          self.build_extension(ext)
          ~~~~~~~~~~~~~~~~~~~~^^^^^
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 543, in build_extension
          sources = self.swig_sources(sources, ext)
        File "C:\Users\SPIVEYA23\AppData\Local\Temp\pip-build-env-w8y0yvxq\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 641, in swig_sources
          swig = self.swig or self.find_swig()
                              ~~~~~~~~~~~~~~^^
        File "<string>", line 49, in find_swig
      AssertionError
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for jamspell
Failed to build jamspell
error: failed-wheel-build-for-install

× Failed to build installable wheels for some pyproject.toml based projects

System information:
OS: Microsoft Windows 11 Education, version 24H2, OS build 26100.6899
Python version: Python 3.17.7
Pip version: 25.2
Swig version: 3.0.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions