localstack 0.12.18 fails to install

Question:

I am trying to install localstack 0.12.18 on a windows 10 Enterprise machine.

I’m running Python 3.9.0 and pip 23.0.1.

I have downloaded the .tar.gz file directly from pypi.org and installing it via:

pip install C:UsersmeDownloadslocalstack-0.12.18.tar.gz --trusted-host pypi.org --trusted-host files.pythonhosted.org

This is the output:

pip install C:UsersmeDownloadslocalstack-0.12.18.tar.gz --trusted-host pypi.org --trusted-host files.pythonhosted.org
Processing c:usersmedownloadslocalstack-0.12.18.tar.gz
  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
  ╰─> [19 lines of output]
      Traceback (most recent call last):
        File "C:Anacondaenvspython390libsite-packagespip_vendorpyproject_hooks_in_process_in_process.py", line 353, in <module>
          main()
        File "C:Anacondaenvspython390libsite-packagespip_vendorpyproject_hooks_in_process_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:Anacondaenvspython390libsite-packagespip_vendorpyproject_hooks_in_process_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:UsersmeAppDataLocalTemppip-build-env-hvz55xsaoverlayLibsite-packagessetuptoolsbuild_meta.py", line 338, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "C:UsersmeAppDataLocalTemppip-build-env-hvz55xsaoverlayLibsite-packagessetuptoolsbuild_meta.py", line 320, in _get_build_requires
          self.run_setup()
        File "C:UsersmeAppDataLocalTemppip-build-env-hvz55xsaoverlayLibsite-packagessetuptoolsbuild_meta.py", line 484, in run_setup
          super(_BuildMetaLegacyBackend,
        File "C:UsersmeAppDataLocalTemppip-build-env-hvz55xsaoverlayLibsite-packagessetuptoolsbuild_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 54, in <module>
        File "C:Anacondaenvspython390libencodingscp1252.py", line 23, in decode
          return codecs.charmap_decode(input,self.errors,decoding_table)[0]
      UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 2184: character maps to <undefined>
      [end of output]

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

× Getting requirements to build wheel 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.

Any ideas on what the solution might be?

Thank you

Answers:

I was able to fix this issue by setting the following environment variable prior to executing the pip command: setx PYTHONUTF8 1. Now the installations go through.

I arrived at this solution through this SO post: UnicodeEncodeError: 'charmap' codec can't encode characters

Answered By: alessandro ferrucci