Python安装“asyncio”错误:cl.exe文件失败,退出状态为2

2024-06-08 15:07:47 发布

您现在位置:Python中文网/ 问答频道 /正文

安装asyncio时遇到错误。pydiscovery需要Asyncio。已经安装了Python 2.7的Visual C++,但尚未修复该问题。可能是因为它与Windows10不兼容吗?如果有人知道解决这个问题的方法,请帮忙。在

    pip install asyncio

....

    overlapped.c(68) : error C2065: 'PyExc_ConnectionRefusedError' : undeclared identifier
    overlapped.c(68) : warning C4047: '=' : 'PyObject *' differs in levels of indirection from 'int'
    overlapped.c(71) : error C2065: 'PyExc_ConnectionAbortedError' : undeclared identifier
    overlapped.c(71) : warning C4047: '=' : 'PyObject *' differs in levels of indirection from 'int'
    overlapped.c(714) : warning C4013: 'Py_MIN' undefined; assuming extern returning int
    overlapped.c(716) : warning C4013: 'Py_MAX' undefined; assuming extern returning int
    overlapped.c(1145) : warning C4013: 'PyUnicode_AsWideCharString' undefined; assuming extern returning int
    overlapped.c(1145) : warning C4047: '=' : 'wchar_t *' differs in levels of indirection from 'int'
    overlapped.c(1287) : error C2079: 'overlapped_module' uses undefined struct 'PyModuleDef'
    overlapped.c(1288) : error C2065: 'PyModuleDef_HEAD_INIT' : undeclared identifier
    overlapped.c(1288) : error C2099: initializer is not a constant
    overlapped.c(1289) : warning C4047: 'initializing' : 'int' differs in levels of indirection from 'char [12]'
    overlapped.c(1290) : error C2078: too many initializers
    overlapped.c(1310) : warning C4098: 'PyInit__overlapped' : 'void' function returning a value
    overlapped.c(1314) : warning C4098: 'PyInit__overlapped' : 'void' function returning a value
    overlapped.c(1317) : warning C4098: 'PyInit__overlapped' : 'void' function returning a value
    overlapped.c(1319) : warning C4013: 'PyModule_Create' undefined; assuming extern returning int
    overlapped.c(1319) : warning C4047: '=' : 'PyObject *' differs in levels of indirection from 'int'
    overlapped.c(1321) : warning C4098: 'PyInit__overlapped' : 'void' function returning a value
    overlapped.c(1336) : warning C4098: 'PyInit__overlapped' : 'void' function returning a value
    error: command 'C:\\Users\\marjoriet\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\marjor~1\\appdata\\local\\temp\\pip-build-uektzl\\asyncio\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\marjor~1\appdata\local\temp\pip-zyzgic-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\marjor~1\appdata\local\temp\pip-build-uektzl\asyncio\`enter code here`

Tags: ofinfromerrorpyinitintreturninglevels