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

[pip install timecode] UnicodeDecodeError: 'cp950' codec can't decode byte 0xc3 in position 9097: illegal multibyte sequence #55

Closed
FlyDogDaDa opened this issue May 15, 2024 · 1 comment · Fixed by #56

Comments

@FlyDogDaDa
Copy link

I try pip install timecode, but I get encoding errors.

(.venv) D:\.....\.venv\Scripts>pip install timecode
Collecting timecode
  Using cached timecode-1.4.0.tar.gz (43 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
  ╰─> [18 lines of output]
      Traceback (most recent call last):
        File "d:\.....\.venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "d:\.....\.venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "d:\.....\.venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "D:\TEMP\pip-build-env-m_q5666t\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "D:\TEMP\pip-build-env-m_q5666t\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "D:\TEMP\pip-build-env-m_q5666t\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
          super().run_setup(setup_script=setup_script)
        File "D:\TEMP\pip-build-env-m_q5666t\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 25, in <module>
        File "<string>", line 18, in read_file
      UnicodeDecodeError: 'cp950' codec can't decode byte 0xc3 in position 9097: illegal multibyte sequence
      [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.

I tried to modify the installation program to make it run normally, but I failed. I am not very good at python, sorry.

@FlyDogDaDa
Copy link
Author

I edited the encoding of setup.py and then called pip install timecode-master

def read_file(file_path):
    """Read the given file at file_path.

    Args:
        file_path (str): The file path to read.

    Returns:
        str: The file content.
    """
    with open(file_path, encoding="utf-8") as f:
        data = f.read()
    return data

It works for me.
The installation was successful. I hope it can be updated to the default installation method in the future.

eoyilmaz added a commit that referenced this issue Jul 8, 2024
@eoyilmaz eoyilmaz linked a pull request Jul 8, 2024 that will close this issue
eoyilmaz added a commit that referenced this issue Jul 8, 2024
…ecodeerror-cp950-codec-cant-decode-byte-0xc3-in-position-9097-illegal-multibyte-sequence

[#55] Fix encoding issue in `setup.py`.
eoyilmaz added a commit to austinwitherspoon/timecode that referenced this issue Jul 8, 2024
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.

2 participants