首页 > 其他分享 >Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4)

Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4)

时间:2022-09-03 23:14:46浏览次数:70  
标签:sasl2 Could article blog start sasl SASL net

使用pyhive的时候出现了这个问题,我使用的是anaconda3。查了很多帖子都不能解决。

参考:

https://blog.csdn.net/weixin_43142260/article/details/115198097

https://blog.csdn.net/wenjun_xiao/article/details/104458940

https://blog.csdn.net/qq_15821487/article/details/116499466

https://blog.csdn.net/master_hunter/article/details/125003692

(以上都未能解决我的问题)

 

反正捣鼓来捣鼓去,发现是sasl需要使用E:\YingYongRJ\Anaconda\Lib\site-packages\sasl\sasl2目录里的一些dll文件。

最后文章4给了我启示。

发现anaconda3把地址最后这个文件夹sasl2移动到了E:\YingYongRJ\Anaconda\Library\bin,导致程序读取不到位置。

用了文章2给的代码:管理员控制台粘贴代码:

FOR /F "usebackq delims=" %A IN (`python -c "from importlib import util;import os;print(os.path.join(os.path.dirname(util.find_spec('sasl').origin),'sasl2'))"`) DO (
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Carnegie Mellon\Project Cyrus\SASL Library" /v SearchPath /t REG_SZ /d "%A"
)

(anaconda2用法不一样,详细看文章2)

以上代码是在注册表里创建一个lib的搜索路径。但是还是不能用,我们还需要再改一下下:

win+R里面输入regedit

regedit里点开路径:HKEY_LOCAL_MACHINE\SOFTWARE\Carnegie Mellon\Project Cyrus\SASL Library

把SearchPath的值改为E:\YingYongRJ\Anaconda\Library\bin\sasl2就好了(注意改为自己anaconda的地址)

然后就好了okk~

标签:sasl2,Could,article,blog,start,sasl,SASL,net
From: https://www.cnblogs.com/stroking-maple/p/16653913.html

相关文章