无法安装 python-binance

时间:2021-02-13 02:41:34

标签: python binance

我正在尝试安装 python-binance,但一直收到以下错误消息:

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWIN32=1 -Ic:MYPATH\venv\include -IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\include -IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tcsrc/twisted/test/raiser.c /Fobuild\temp.win-amd64-3.9\Release\src/twisted/test/raiser.obj
    raiser.c
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:MYPATH\venv\libs /LIBPATH:C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\libs /LIBPATH:MYPATH\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0 /LIBPATH:MYPATH\venv\PCbuild\amd64 /LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\lib\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64 /EXPORT:PyInit_raiser build\temp.win-amd64-3.9\Release\src/twisted/test/raiser.obj /OUT:build\lib.win-amd64-3.9\twisted\test\raiser.cp39-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.9\Release\src/twisted/test\raiser.cp39-win_amd64.lib
       Creating library build\temp.win-amd64-3.9\Release\src/twisted/test\raiser.cp39-win_amd64.lib and object build\temp.win-amd64-3.9\Release\src/twisted/test\raiser.cp39-win_amd64.exp
    Generating code
    Finished generating code
    building 'twisted.internet.iocpreactor.iocpsupport' extension
    creating build\temp.win-amd64-3.9\Release\src\twisted\internet
    creating build\temp.win-amd64-3.9\Release\src\twisted\internet\iocpreactor
    creating build\temp.win-amd64-3.9\Release\src\twisted\internet\iocpreactor\iocpsupport
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWIN32=1 -IMYPATH\venv\include -IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\include -IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tcsrc/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c /Fobuild\temp.win-amd64-3.9\Release\src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.obj
    iocpsupport.c
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(2229): warning C4047: '=': '__pyx_t_11iocpsupport_HANDLE' differs in levels of indirection from 'HANDLE'
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(2377): warning C4022: 'CreateIoCompletionPort': pointer mismatch for actual parameter 1
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(2377): warning C4022: 'CreateIoCompletionPort': pointer mismatch for actual parameter 2
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(2377): warning C4047: '=': '__pyx_t_11iocpsupport_HANDLE' differs in levels of indirection from 'HANDLE'
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(2492): warning C4022: 'GetQueuedCompletionStatus': pointer mismatch for actual parameter 1
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(2838): warning C4022: 'PostQueuedCompletionStatus': pointer mismatch for actual parameter 1
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(2949): warning C4022: 'CloseHandle': pointer mismatch for actual parameter 1
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(3292): warning C4996: 'PyObject_AsReadBuffer': deprecated in 3.0
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(4932): warning C4996: 'PyObject_AsWriteBuffer': deprecated in 3.0
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(5149): warning C4996: 'PyObject_AsReadBuffer': deprecated in 3.0
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(5786): warning C4996: 'PyObject_AsWriteBuffer': deprecated in 3.0
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(6146): warning C4996: 'PyObject_AsWriteBuffer': deprecated in 3.0
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(6164): warning C4996: 'PyObject_AsWriteBuffer': deprecated in 3.0
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(6182): warning C4996: 'PyObject_AsWriteBuffer': deprecated in 3.0
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(6509): warning C4996: 'PyObject_AsReadBuffer': deprecated in 3.0
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(7614): error C2039: 'tp_print': is not a member of '_typeobject'
    C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0\include\cpython/object.h(193): note: see declaration of '_typeobject'
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(8421): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
    src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(8437): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2

我相信主要是 Twisted 模块给了我错误信息。完整的错误信息要大得多。

这是错误信息的最后一行。

ERROR: Command errored out with exit status 1: 'MYPATH\venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'MYPATH\\AppData\\Local\\Temp\\pip-install-yzrozhu7\\twisted_25d437e14b574311a90ed5582026c087\\setup.py'"'"'; __file__='"'"'MYPATH\\AppData\\Local\\Temp\\pip-install-yzrozhu7\\twisted_25d437e14b574311a90ed5582026c087\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'MYPATH\AppData\Local\Temp\pip-record-3qk672yw\install-record.txt' --single-version-externally-managed --compile --install-headers 'MYPATH\venv\include\site\python3.9\Twisted' Check the logs for full command output.

我安装了 Visual Studios C++ 构建工具。

1 个答案:

答案 0 :(得分:1)

试试下面的命令:

pip uninstall Twisted
pip install pipwin
pipwin refresh
pipwin install Twisted
pip install python-binance