Skip to content

UTF-8 Based Error to Install on Windows #2

@hwhaples

Description

@hwhaples

Running pip install zernipax on Windows 11 (Python 3.13) within a fresh Anaconda environment yields the following install error:

Collecting zernipax
  Downloading zernipax-0.1.1-py3-none-any.whl.metadata (1.2 kB)
Collecting jax<=0.5.0,>=0.3.2 (from jax[cpu]<=0.5.0,>=0.3.2->zernipax)
  Downloading jax-0.5.0-py3-none-any.whl.metadata (22 kB)
Requirement already satisfied: matplotlib<=4.0.0,>=3.5.0 in C:\Users\hunte\miniconda3\envs\zernike\Lib\site-packages (from zernipax) (3.10.9)
Collecting mpmath>=1.0.0 (from zernipax)
  Downloading mpmath-1.4.1-py3-none-any.whl.metadata (9.1 kB)
Collecting numpy<2.0.0,>=1.20.0 (from zernipax)
  Downloading numpy-1.26.4.tar.gz (15.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 15.8/15.8 MB 82.1 MB/s  0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting nvgpu (from zernipax)
  Downloading nvgpu-0.10.0.tar.gz (8.4 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      Traceback (most recent call last):
        File "C:\Users\hunte\miniconda3\envs\zernike\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module>
          main()
          ~~~~^^
        File "C:\Users\hunte\miniconda3\envs\zernike\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\hunte\miniconda3\envs\zernike\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:\Users\hunte\AppData\Local\Temp\pip-build-env-1y_ycv3d\overlay\Lib\site-packages\setuptools\build_meta.py", line 333, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\hunte\AppData\Local\Temp\pip-build-env-1y_ycv3d\overlay\Lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "C:\Users\hunte\AppData\Local\Temp\pip-build-env-1y_ycv3d\overlay\Lib\site-packages\setuptools\build_meta.py", line 520, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\hunte\AppData\Local\Temp\pip-build-env-1y_ycv3d\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 33, in <module>
        File "<string>", line 6, in read_file
        File "C:\Users\hunte\miniconda3\envs\zernike\Lib\encodings\cp1252.py", line 23, in decode
          return codecs.charmap_decode(input,self.errors,decoding_table)[0]
                 ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 4846: character maps to <undefined>
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed to build 'nvgpu' when getting requirements to build wheel

This traces back to the nvgpu package which throws a similar install error when installed directly:

Collecting nvgpu
  Using cached nvgpu-0.10.0.tar.gz (8.4 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      Traceback (most recent call last):
        File "C:\Users\hunte\miniconda3\envs\zernike\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module>
          main()
        File "C:\Users\hunte\miniconda3\envs\zernike\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\hunte\miniconda3\envs\zernike\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\hunte\AppData\Local\Temp\pip-build-env-fqvnxj5r\overlay\Lib\site-packages\setuptools\build_meta.py", line 333, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\hunte\AppData\Local\Temp\pip-build-env-fqvnxj5r\overlay\Lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires
          self.run_setup()
        File "C:\Users\hunte\AppData\Local\Temp\pip-build-env-fqvnxj5r\overlay\Lib\site-packages\setuptools\build_meta.py", line 520, in run_setup
          super().run_setup(setup_script=setup_script)
        File "C:\Users\hunte\AppData\Local\Temp\pip-build-env-fqvnxj5r\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup
          exec(code, locals())
        File "<string>", line 33, in <module>
        File "<string>", line 6, in read_file
        File "C:\Users\hunte\miniconda3\envs\zernike\Lib\encodings\cp1252.py", line 23, in decode
          return codecs.charmap_decode(input,self.errors,decoding_table)[0]
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 4846: character maps to <undefined>
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed to build 'nvgpu' when getting requirements to build wheel

This is resolved by running:

set PYTHONUTF8=1
pip install nvgpu

Followed by pip install zernipax leading a successful installation from pip.

Unknown if there are other downstream effects from setting python to UTF-8 on Windows with the Zernipax library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions