Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix available] Local Installation fails due to unknown encoding of readme.md #407

Closed
simon376 opened this issue Jul 6, 2022 · 0 comments · Fixed by #419
Closed

[Fix available] Local Installation fails due to unknown encoding of readme.md #407

simon376 opened this issue Jul 6, 2022 · 0 comments · Fixed by #419

Comments

@simon376
Copy link

simon376 commented Jul 6, 2022

Describe the bug

  • When trying to install anomalib locally, as described in the readme.md, using pip install -e ., the command fails.
  • This happens, because in setup.py, the content of the readme is read into the LONG_DESCRIPTION, without specifying the encoding used.

To Reproduce
Steps to reproduce the behavior:

  1. run pip install -e . from the root directory
  2. See error

Expected behavior

  • the library and all required components are installed properly

Error Message

(.venv) C:\Users\USERNAME\dev\anomalib-fork>pip install -e .
Obtaining file:///C:/Users/USERNAME/dev/anomalib-fork
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "C:\Users\USERNAME\dev\anomalib-fork\.venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
          main()
        File "C:\Users\USERNAME\dev\anomalib-fork\.venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:\Users\USERNAME\dev\anomalib-fork\.venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:\Users\USERNAME\AppData\Local\Temp\pip-build-env-nxo18pxf\overlay\Lib\site-packages\setuptools\build_meta.py", line 177, in get_requires_for_build_wheel
          return self._get_build_requires(
        File "C:\Users\USERNAME\AppData\Local\Temp\pip-build-env-nxo18pxf\overlay\Lib\site-packages\setuptools\build_meta.py", line 159, in _get_build_requires
          self.run_setup()
        File "C:\Users\USERNAME\AppData\Local\Temp\pip-build-env-nxo18pxf\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        **File "setup.py", line 91, in <module>
          LONG_DESCRIPTION = (Path(__file__).parent / "README.md").read_text()**
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\pathlib.py", line 1267, in read_text
          return f.read()
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\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 0x8f in position 4247: 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.

Fix
replace this:

LONG_DESCRIPTION = (Path(__file__).parent / "README.md").read_text()

with

LONG_DESCRIPTION = (Path(__file__).parent / "README.md").read_text(encoding='utf8')

Hardware and Software Configuration

  • OS: Windows
  • NVIDIA Driver Version 516.01
  • CUDA Version V11.7.64
@simon376 simon376 changed the title Local Installation fails due to unknown encoding of readme.md [Fix available] Local Installation fails due to unknown encoding of readme.md Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant