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

Looks like the package might still be using PyUnicode libraries, which I think are deprecated as of Python 3.11 #68

Open
simplyandyg opened this issue Oct 23, 2024 · 3 comments

Comments

@simplyandyg
Copy link

We're running into the below error when we're trying to run pre-commit git hooks.

I don't work with Python or Windows very often so I was hoping maybe someone here could provide some insight. But from what I found elsewhere, it looks like the PyUnicode library is deprecated and no longer in python since 3.12, which is the version being used on our system.

      "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.41.34120\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\myUser\.cache\pre-commit\repoqicqzx_a\py_env-python3.12\libs /LIBPATH:C:\Users\myUser\AppData\Local\Programs\Python\Python312\libs /LIBPATH:C:\Users\myUser\AppData\Local\Programs\Python\Python312 /LIBPATH:C:\Users\myUser\.cache\pre-commit\repoqicqzx_a\py_env-python3.12\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.41.34120\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64" /EXPORT:PyInit__levenshtein build\temp.win-amd64-cpython-312\Release\Levenshtein/_levenshtein.obj /OUT:build\lib.win-amd64-cpython-312\Levenshtein\_levenshtein.cp312-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-312\Release\Levenshtein\_levenshtein.cp312-win_amd64.lib
         Creating library build\temp.win-amd64-cpython-312\Release\Levenshtein\_levenshtein.cp312-win_amd64.lib and object build\temp.win-amd64-cpython-312\Release\Levenshtein\_levenshtein.cp312-win_amd64.exp
      _levenshtein.obj : error LNK2001: unresolved external symbol PyUnicode_FromUnicode
      _levenshtein.obj : error LNK2001: unresolved external symbol PyUnicode_GET_SIZE
      _levenshtein.obj : error LNK2001: unresolved external symbol PyUnicode_AS_UNICODE
      build\lib.win-amd64-cpython-312\Levenshtein\_levenshtein.cp312-win_amd64.pyd : fatal error LNK1120: 3 unresolved externals
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120
      [end of output]

      note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed building wheel for python-Levenshtein-wheels
    ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (python-Levenshtein-wheels)
Check the log at C:\Users\myUser\.cache\pre-commit\pre-commit.log
@maxbachmann
Copy link
Member

This sounds like you are trying to compile a very old version. I removed the usage of PyUnicode APIs around 3 years ago.

@maxbachmann
Copy link
Member

From your error it looks like you are installing python-Levenshtein-wheels which is not maintained by me. It was a fork at some point when the project didn't provide wheels.

You should directly install Levenshtein instead.

@simplyandyg
Copy link
Author

simplyandyg commented Oct 23, 2024 via email

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

No branches or pull requests

2 participants