我正在尝试安装 PyHive 以在 Python 中执行 Hive 查询。作为先决条件,我尝试安装 SASL,但它给出了以下错误。我的 python 版本是 3.9.5 并且正在使用 Windows 操作系统。有人可以帮忙解决这个错误吗?
ERROR: Command errored out with exit status 1:
command: 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ramara60\\AppData\\Local\\Temp\\1\\pip-install-xk4q6frw\\sasl_24caec85d8cb48c39399c618dd595362\\setup.py'"'"'; __file__='"'"'C:\\Users\\ramara60\\AppData\\Local\\Temp\\1\\pip-install-xk4q6frw\\sasl_24caec85d8cb48c39399c618dd595362\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\ramara60\AppData\Local\Temp\1\pip-wheel-5dp6lybo'
cwd: C:\Users\ramara60\AppData\Local\Temp\1\pip-install-xk4q6frw\sasl_24caec85d8cb48c39399c618dd595362\
Complete output (27 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\sasl
copying sasl\__init__.py -> build\lib.win-amd64-3.8\sasl
running egg_info
writing sasl.egg-info\PKG-INFO
writing dependency_links to sasl.egg-info\dependency_links.txt
writing requirements to sasl.egg-info\requires.txt
writing top-level names to sasl.egg-info\top_level.txt
reading manifest file 'sasl.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'sasl.egg-info\SOURCES.txt'
copying sasl\saslwrapper.cpp -> build\lib.win-amd64-3.8\sasl
copying sasl\saslwrapper.h -> build\lib.win-amd64-3.8\sasl
copying sasl\saslwrapper.pyx -> build\lib.win-amd64-3.8\sasl
running build_ext
building 'sasl.saslwrapper' extension
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
creating build\temp.win-amd64-3.8\Release\sasl
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Isasl -IC:\ProgramData\Anaconda3\include -IC:\ProgramData\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /Tpsasl/saslwrapper.cpp /Fobuild\temp.win-amd64-3.8\Release\sasl/saslwrapper.obj
saslwrapper.cpp
C:\Users\ramara60\AppData\Local\Temp\1\pip-install-xk4q6frw\sasl_24caec85d8cb48c39399c618dd595362\sasl\saslwrapper.h(22): fatal error C1083: Cannot open include file: 'sasl/sasl.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for sasl
ERROR: Command errored out with exit status 1:
command: 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ramara60\\AppData\\Local\\Temp\\1\\pip-install-xk4q6frw\\sasl_24caec85d8cb48c39399c618dd595362\\setup.py'"'"'; __file__='"'"'C:\\Users\\ramara60\\AppData\\Local\\Temp\\1\\pip-install-xk4q6frw\\sasl_24caec85d8cb48c39399c618dd595362\\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\ramara60\AppData\Local\Temp\1\pip-record-mfkofm_6\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\ProgramData\Anaconda3\Include\sasl'
cwd: C:\Users\ramara60\AppData\Local\Temp\1\pip-install-xk4q6frw\sasl_24caec85d8cb48c39399c618dd595362\
Complete output (27 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\sasl
copying sasl\__init__.py -> build\lib.win-amd64-3.8\sasl
running egg_info
writing sasl.egg-info\PKG-INFO
writing dependency_links to sasl.egg-info\dependency_links.txt
writing requirements to sasl.egg-info\requires.txt
writing top-level names to sasl.egg-info\top_level.txt
reading manifest file 'sasl.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'sasl.egg-info\SOURCES.txt'
copying sasl\saslwrapper.cpp -> build\lib.win-amd64-3.8\sasl
copying sasl\saslwrapper.h -> build\lib.win-amd64-3.8\sasl
copying sasl\saslwrapper.pyx -> build\lib.win-amd64-3.8\sasl
running build_ext
building 'sasl.saslwrapper' extension
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
creating build\temp.win-amd64-3.8\Release\sasl
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Isasl -IC:\ProgramData\Anaconda3\include -IC:\ProgramData\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /Tpsasl/saslwrapper.cpp /Fobuild\temp.win-amd64-3.8\Release\sasl/saslwrapper.obj
saslwrapper.cpp
C:\Users\ramara60\AppData\Local\Temp\1\pip-install-xk4q6frw\sasl_24caec85d8cb48c39399c618dd595362\sasl\saslwrapper.h(22): fatal error C1083: Cannot open include file: 'sasl/sasl.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ramara60\\AppData\\Local\\Temp\\1\\pip-install-xk4q6frw\\sasl_24caec85d8cb48c39399c618dd595362\\setup.py'"'"'; __file__='"'"'C:\\Users\\ramara60\\AppData\\Local\\Temp\\1\\pip-install-xk4q6frw\\sasl_24caec85d8cb48c39399c618dd595362\\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\ramara60\AppData\Local\Temp\1\pip-record-mfkofm_6\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\ProgramData\Anaconda3\Include\sasl' Check the logs for full command output.