[Solved] pyhive error: Could not start SASL: b’Error in sasl_client_start (-4) SASL(-4)

I have this problem when using pyhive, I am using anaconda3. I have checked many posts but I can’t solve it.

At first I found out that sasl needs to use some dll files in the E:\YingYongRJ\Anaconda\Lib\site-packages\sasl\sasl2 directory.

Finally found that anaconda3 moved this folder sasl2 at the end of the address to E:\YingYongRJ\Anaconda\Library\bin, resulting in the program not reading the location.

Use the following code: administrator console paste code.

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"


The above code is creating a search path for lib in the registry. But it still doesn’t work, we need to change it a bit more.

win+R and type regedit

regedit and click on the path: HKEY_LOCAL_MACHINE\SOFTWARE\Carnegie Mellon\Project Cyrus\SASL Library

Change the value of SearchPath to E:\YingYongRJ\Anaconda\Library\bin\sasl2 on it (pay attention to change to the address of their anaconda)

Then it’s fine

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *