当前位置: 首页 > news >正文

解决 openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PySequence_List 错误

pip 安装依赖时报错如下

正在创建库 build\temp.win32-cpython-310\Release\lib\open_jtalk\src\jpcommon\openjtalk.cp310-win_amd64.lib 和对象 build\temp.win32-cpython-310\Release\lib\open_jtalk\src\jpcommon\openjtalk.cp310-win_amd64.exp
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PySequence_List
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyBaseObject_Type
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp___PyDict_NewPresized
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyGC_Enable
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_SetAttr
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyUnicode_InternFromString
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyCFunction_Type
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyOS_snprintf
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyThreadState_Get
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_Exception
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_SetObject
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyCode_NewEmpty
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_GivenExceptionMatches
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyLong_AsUnsignedLong
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_WarnEx
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_RuntimeWarning
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_PrintEx
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyFrame_New
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_DeprecationWarning
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_KeyError
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__Py_LeaveRecursiveCall
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyImport_ImportModule
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp___PyLong_AsByteArray
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyImport_ImportModuleLevelObject
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_NormalizeException
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_Occurred
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyLong_FromSsize_t
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyUnicode_DecodeUTF8
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_GenericGetAttr
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyTraceBack_Here
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp___PyThreadState_UncheckedGet
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_RuntimeError
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyMethod_New
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_IOError
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_SetAttrString
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyLong_FromLong
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_GC_UnTrack
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_Hash
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_MemoryError
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyDict_GetItemWithError
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyInterpreterState_GetID
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyLong_FromUnsignedLongLong
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__Py_GetVersion
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_GetAttr
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyLong_AsUnsignedLongLong
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyBytes_FromString
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyGILState_Release
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyBytes_AsStringAndSize
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp___Py_NoneStruct
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyLong_AsLongLong
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyTuple_New
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyDict_SetItemString
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyDict_Size
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyLong_FromLongLong
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyGC_Disable
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_AttributeError
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyTuple_GetSlice
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_SetString
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_WriteUnraisable
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyUnicode_AsASCIIString
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_GetIter
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_WarnFormat
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_ValueError
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyLong_FromUnsignedLong
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyDict_Next
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_Format
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyDict_Type
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_ArithmeticError
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_RichCompare
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyTuple_Type
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp___Py_FalseStruct
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyImport_GetModule
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyFloat_Type
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp___PyLong_FromByteArray
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyModule_NewObject
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyMethod_Type
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyLong_Type
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyType_IsSubtype
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_Restore
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyUnicode_Join
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_OverflowError
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyCode_NewWithPosOnlyArgs
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp___Py_Dealloc
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyTuple_GetItem
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyImport_GetModuleDict
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyModule_GetDict
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PySequence_GetSlice
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_Free
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_ExceptionMatches
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyCapsule_GetPointer
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_GC_Del
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_Fetch
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyLong_AsLong
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyDescr_IsData
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_ClearWeakRefs
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_Not
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyUnicode_AsUTF8
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyUnicode_FromFormat
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyList_New
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PySlice_New
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_GC_IsFinalized
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyImport_AddModule
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyType_Ready
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_GetAttrString
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_Clear
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyList_Append
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyBytes_Type
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_RichCompareBool
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyUnicode_Decode
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyException_SetTraceback
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp___PyObject_GenericGetAttrWithDict
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_VectorcallDict
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyDict_SetItem
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyDict_New
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyUnicode_Type
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_CallFinalizerFromDealloc
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp___PyDict_GetItem_KnownHash
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyMem_Free
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_StopIteration
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyList_Type
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_NoMemory
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyDict_GetItemString
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_GetItem
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_CallObject
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyModuleDef_Init
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_GC_Track
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyBytes_FromStringAndSize
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyGILState_Ensure
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyDict_DelItem
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyUnicode_Compare
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_IsSubclass
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_TypeError
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyMem_Realloc
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyCapsule_Type
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_IsTrue
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_NameError
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyTuple_Pack
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp___PyByteArray_empty_string
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp___PyUnicode_Ready
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyMem_Malloc
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_IndexError
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__Py_EnterRecursiveCall
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_ImportError
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp___Py_TrueStruct
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_SystemError
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp___PyObject_GC_New
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyException_SetCause
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyType_Modified
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyTraceBack_Type
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyUnicode_FromString
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp___PyType_Lookup
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_Call
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyByteArray_Type
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyUnicode_FromStringAndSize
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_ModuleNotFoundError
      openjtalk.obj : error LNK2001: 无法解析的外部符号 __imp___PyObject_GetDictPtr
      build\lib.win32-cpython-310\pyopenjtalk\openjtalk.cp310-win_amd64.pyd : fatal error LNK1120: 156 个无法解析的外部 命令
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.43.34808\\bin\\HostX86\\x86\\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 pyopenjtalk
  Building wheel for jieba_fast (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [73 lines of output]
      jieba_fast_functions_wrap_py3_wrap.c
      jieba_fast/source/jieba_fast_functions_wrap_py3_wrap.c(3190): warning C4090: “初始化”: 不同的“const”限定符
        正在创建库 build\temp.win32-cpython-310\Release\jieba_fast\source\_jieba_fast_functions_py3.cp310-win_amd64.lib 和对象 build\temp.win32-cpython-310\Release\jieba_fast\source\_jieba_fast_functions_py3.cp310-win_amd64.exp
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PySequence_Size
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_SetAttr
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyBool_FromLong
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PySequence_GetItem
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_Occurred
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_GenericGetAttr
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_RuntimeError
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_IOError
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyLong_FromLong
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyUnicode_Concat
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__Py_BuildValue
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_MemoryError
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyDict_Contains
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyFloat_AsDouble
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyTuple_New
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyDict_SetItemString
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyFloat_FromDouble
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_AttributeError
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyList_Size
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_SetString
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_ZeroDivisionError
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_WriteUnraisable
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_ValueError
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyFloat_Type
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyType_IsSubtype
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_Restore
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_OverflowError
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp___Py_Dealloc
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyTuple_GetItem
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyModule_GetDict
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PySequence_GetSlice
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_Free
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyCapsule_GetPointer
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyModule_AddObject
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_Fetch
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_CallFunctionObjArgs
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyLong_AsLong
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyUnicode_AsUTF8
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyUnicode_FromFormat
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyList_New
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyModule_Create2
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyImport_AddModule
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyType_Ready
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_SyntaxError
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyErr_Clear
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyList_Append
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyLong_AsDouble
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyCapsule_New
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyDict_SetItem
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyList_GetItem
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyInstanceMethod_New
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyLong_FromVoidPtr
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyCapsule_Import
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyTuple_SetItem
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyDict_GetItem
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__Py_DecRef
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp___Py_NotImplementedStruct
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp___PyObject_New
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_TypeError
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_IsTrue
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_IndexError
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyArg_UnpackTuple
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyExc_SystemError
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyList_SetItem
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyUnicode_FromString
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyObject_Call
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyArg_ParseTuple
      jieba_fast_functions_wrap_py3_wrap.obj : error LNK2001: 无法解析的外部符号 __imp__PyUnicode_FromStringAndSize
      build\lib.win32-cpython-310\_jieba_fast_functions_py3.cp310-win_amd64.pyd : fatal error LNK1120: 68 个无法解析的外部命令
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.43.34808\\bin\\HostX86\\x86\\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 jieba_fast
  Running setup.py clean for jieba_fast
  Building wheel for pynini (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [49 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build\lib.win32-cpython-310\pynini
      copying pynini\__init__.py -> build\lib.win32-cpython-310\pynini
      creating build\lib.win32-cpython-310\pywrapfst
      copying pywrapfst\__init__.py -> build\lib.win32-cpython-310\pywrapfst
      creating build\lib.win32-cpython-310\pynini\examples
      copying pynini\examples\case.py -> build\lib.win32-cpython-310\pynini\examples
      copying pynini\examples\chatspeak.py -> build\lib.win32-cpython-310\pynini\examples
      copying pynini\examples\chatspeak_model.py -> build\lib.win32-cpython-310\pynini\examples
      copying pynini\examples\dates.py -> build\lib.win32-cpython-310\pynini\examples
      copying pynini\examples\g2p.py -> build\lib.win32-cpython-310\pynini\examples
      copying pynini\examples\numbers.py -> build\lib.win32-cpython-310\pynini\examples
      copying pynini\examples\plurals.py -> build\lib.win32-cpython-310\pynini\examples
      copying pynini\examples\t9.py -> build\lib.win32-cpython-310\pynini\examples
      copying pynini\examples\weather.py -> build\lib.win32-cpython-310\pynini\examples
      copying pynini\examples\__init__.py -> build\lib.win32-cpython-310\pynini\examples
      creating build\lib.win32-cpython-310\pynini\export
      copying pynini\export\export.py -> build\lib.win32-cpython-310\pynini\export
      copying pynini\export\grm.py -> build\lib.win32-cpython-310\pynini\export
      copying pynini\export\grm_example.py -> build\lib.win32-cpython-310\pynini\export
      copying pynini\export\multi_grm.py -> build\lib.win32-cpython-310\pynini\export
      copying pynini\export\multi_grm_example.py -> build\lib.win32-cpython-310\pynini\export
      copying pynini\export\__init__.py -> build\lib.win32-cpython-310\pynini\export
      creating build\lib.win32-cpython-310\pynini\lib
      copying pynini\lib\byte.py -> build\lib.win32-cpython-310\pynini\lib
      copying pynini\lib\edit_transducer.py -> build\lib.win32-cpython-310\pynini\lib
      copying pynini\lib\features.py -> build\lib.win32-cpython-310\pynini\lib
      copying pynini\lib\paradigms.py -> build\lib.win32-cpython-310\pynini\lib
      copying pynini\lib\pynutil.py -> build\lib.win32-cpython-310\pynini\lib
      copying pynini\lib\rewrite.py -> build\lib.win32-cpython-310\pynini\lib
      copying pynini\lib\rule_cascade.py -> build\lib.win32-cpython-310\pynini\lib
      copying pynini\lib\tagger.py -> build\lib.win32-cpython-310\pynini\lib
      copying pynini\lib\utf8.py -> build\lib.win32-cpython-310\pynini\lib
      copying pynini\lib\__init__.py -> build\lib.win32-cpython-310\pynini\lib
      copying pynini\__init__.pyi -> build\lib.win32-cpython-310\pynini
      copying pynini\py.typed -> build\lib.win32-cpython-310\pynini
      copying pywrapfst\__init__.pyi -> build\lib.win32-cpython-310\pywrapfst
      copying pywrapfst\py.typed -> build\lib.win32-cpython-310\pywrapfst
      copying pynini\examples\py.typed -> build\lib.win32-cpython-310\pynini\examples
      copying pynini\export\py.typed -> build\lib.win32-cpython-310\pynini\export
      copying pynini\lib\py.typed -> build\lib.win32-cpython-310\pynini\lib
      running build_ext
      building '_pywrapfst' extension
      creating build\temp.win32-cpython-310\Release\extensions
      "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\HostX86\x86\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\ProgramData\anaconda3\envs\metahuman\include -IC:\ProgramData\anaconda3\envs\metahuman\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" /EHsc /Tpextensions/_pywrapfst.cpp /Fobuild\temp.win32-cpython-310\Release\extensions\_pywrapfst.obj -std=c++17 -Wno-register -Wno-deprecated-declarations -Wno-unused-function -Wno-unused-local-typedefs -funsigned-char
      cl: 命令行 error D8021 :无效的数值参数“/Wno-register”
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.43.34808\\bin\\HostX86\\x86\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pynini
  Running setup.py clean for pynini
Failed to build pyopenjtalk jieba_fast pynini
ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyopenjtalk, jieba_fast, pynini)

解决方案: 

下面的解决方案不一定有效, 请检查你在什么环境下运行的? 换  cmd 命令行工具可能有效, 不要使用  x86 Native Tools Command Prompt for VS 2022

这些错误通常与Python扩展模块的编译环境配置有关,尤其是Windows下编译器兼容性和架构匹配问题。以下是逐步解决方案:


Step 1:确认Python环境架构

首先检查Python环境是32位还是64位:

python -c "import sys; print(sys.executable)"
# 或
python -c "import struct; print(struct.calcsize('P') * 8)"

如果输出是 64,说明是64位Python;如果是 32,则为32位。


Step 2:安装匹配的Visual Studio组件

  1. 卸载现有Visual Studio Build Tools(如果存在冲突)。
  2. 重新安装 Visual Studio 2022 Build Tools,勾选以下组件:
    • “使用C++的桌面开发”
    • “Windows 10/11 SDK”
    • 确保安装的MSVC版本与Python环境匹配(如x64或x86)。

Step 3:修复编译器参数(针对pynini)

cl.exe报错/Wno-register是MSVC不支持的参数。需修改包的编译配置:

  1. 手动修改源码(临时方案):
    • 找到pyninisetup.py或编译脚本。
    • 删除或注释包含-Wno-register的编译参数。
  2. 升级pynini到最新版本(可能已修复此问题):
    pip install --upgrade pynini
    

Step 4:使用Conda安装预编译包(推荐)

许多包在Conda-forge频道提供预编译的Windows二进制包:

conda install -c conda-forge pyopenjtalk jieba_fast pynini

Step 5:安装Python 3.9或更低版本

某些包可能尚未适配Python 3.10:

conda create -n py39 python=3.9
conda activate py39
pip install pyopenjtalk jieba_fast pynini

Step 6:设置环境变量(备用方案)

在命令提示符中设置环境变量以强制使用正确工具链:

SET DISTUTILS_USE_SDK=1
SET MSSdk=1
pip install pyopenjtalk jieba_fast pynini

Step 7:安装Microsoft C++ Build Tools

如果未完全安装MSVC组件:

  1. 下载并运行 Microsoft C++ Build Tools
  2. 安装时选择 “C++桌面开发” 工作负载。

总结:

  1. 优先使用Conda安装预编译包
  2. 若必须从源码编译,确保Python与编译器架构一致(如64位Python使用x64 MSVC工具链)。
  3. 修改不兼容的编译参数或降级Python版本。

如果问题仍未解决,请提供以下信息:

  • Python版本和架构(32/64位)
  • 使用的包版本(如pyopenjtalk==x.x.x
  • 完整的错误日志(如果有新报错)。

相关文章:

  • C语言基础要素(016):入口条件循环:while与for
  • go 通过汇编分析栈布局和函数栈帧
  • SSM文物管理系统
  • chatgpt的一些prompt技巧
  • vue3设置全局滚动条样式
  • 1.5[hardware][day5]
  • 0CTF 2016 piapiapia 1
  • QT MVC 编程 MODEL/DELEGATE/VIEW(五)
  • day04_Java高级
  • OSPF与RIP联动实验
  • Java 并发编程——Java BIO NIO Socket编程
  • cursor全栈网页开发最合适的技术架构和开发语言
  • 进制转换(十进制相关)
  • 1.Qt SDK 的下载和安装
  • [Linux][经验总结]Ubuntu6.11.0 docker更换镜像源
  • Python3中的神秘错误:如何应对UnicodeDecodeError
  • CURL一文通
  • 考研系列-408真题计算机网络篇(10-17)
  • 《基于超高频RFID的图书馆管理系统的设计与实现》开题报告
  • HarmonyOS NEXT开发实战——HUAWEI DevEco Studio 开发指南
  • 屠呦呦当选美国科学院外籍院士
  • 船只深夜撞上海上风机后沉没1死1失踪,调查报告公布
  • 第五届全国医院人文管理路演在昆山举办:患者体验才是温度计
  • 柴德赓、纪庸与叫歇碑
  • 体坛联播|皇马上演罢赛闹剧,杨瀚森宣布参加NBA选秀
  • 【社论】以“法治之盾”护航每一份创新