-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error importing SSL in PyQ #76
Comments
Dear Jeffrey, Unfortunately you ignored the questionnaire in the issue template and told us nothing about your system. From the little information that you gave, it looks like you've installed PyQ in a system location without using a virtual environment. While such configuration may work, it usually requires substantial expertise to get right. For this reason we strongly recommend using a virtual environment. As for your question, no PyQ does not override the SSL library. You can find out which library is used by PyQ as follows: $ ldd $(pyq -c "import _ssl;print(_ssl.__file__)")| grep libssl
libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007f87048a8000) If the same command with pyq replaced by python gives a different result - you have a misconfiguration. Can you post the output of the following commands: ldd $(which python) and cat $QHOME/pyq-config.q where |
Apologize for my under specification. Please see my system setup below. Which operating system are you using (if Linux, please provide flavour of it, i.e RedHat, CentOS or Ubuntu), is it 32-bit, or 64-bit? Red Hat Enterprise Linux Server release 6.9 (Santiago) Which version of PyQ are you running? You can use pyq --versions or pip list | grep pyq. PyQ 4.1.3 Yes with Anaconda Where is your QHOME? Please provide output env | grep QHOME on linux/macOS, or set|grep QHOME on Windows. QHOME=/opt/kx/3.4 Yes. conda 3.14.1 Hi, I'm am using Conda as my virtual environment. the output of ldd $(which python) is (py36an440)[svc_tpmdb_research@pridbtsskdb02 bin]$ ldd $(which python) cat $QHOME/pyq-config.q is \d .p $QHOME location /opt/kx/3.4 |
More information as I dig into this more. I found some difference when running the following two commands. (py36an440)[svc_tpmdb_research@pridbtsskdb02 bin]$ ldd $(which ~/.conda/envs/py36an440/bin/python3.6_org) |
Before we spend more time troubleshooting, since you are using conda, you may want to try our recently released conda package: conda install -c enlnt -c kx pyq |
Did you try ldd $(pyq -c "import _ssl;print(_ssl.__file__)")| grep libssl and compare it with ldd $(python -c "import _ssl;print(_ssl.__file__)")| grep libssl ? Note that |
Yes and I see the following differences. ldd $(pyq -c "import _ssl;print(_ssl.file)")| grep libssl linux-vdso.so.1 => (0x00007ffee79c9000) and compare it with ldd $(python -c "import _ssl;print(_ssl.file)")| grep libssl Note that ldd $(which pyq) is rather pointless because pyq is just glorified exec q python.q. |
OK, now, let's see the paths to _ssl: pyq -c "import _ssl;print(_ssl.__file__)" and python -c "import _ssl;print(_ssl.__file__)" but I already suspect that the problem is with your QHOME location. We recommend setting QHOME to $CONDA_PREFIX/q. You should still be able to fix your setup by setting PYTHONHOME and/or PYTHONPATH. |
Not able to get the path to _ssl for pyq due to import error. But the path to _ssl for python is below /home/svc_tpmdb_research/.conda/envs/py36an440/lib/python3.6/lib-dynload/_ssl.cpython-36m-x86_64-linux-gnu.so |
What is your $CONDA_PREFIX set to? I don't have this variable defined in my env. |
If you don't have CONDA_PREFIX set - you don't have an activated conda env. Did you run conda activate command? Please consult conda documentation. |
Please run PYTHONVERBOSE=2 pyq -c "import _ssl" 2>&1 | grep ssl |
got the following when running the above command trying /home/svc_tpmdb_research/.conda/envs/py36an440/bin/_ssl.cpython-36m-x86_64-linux-gnu.so |
That's interesting. So both pyq and python load the same _ssl module, but get different libssl's. We have too look deeper. Do you haves strace installed? Try strace pyq -c 'import _ssl' 2>&1 | grep libssl and the same with python. |
Thank you for your help. I think we are slowly seeing something. Please see the trace results for both pyq and python strace python -c 'Import _ssl' 2>&1 | grep libssl strace pyq -c 'Import _ssl' 2>&1 | grep libssl |
Why does pyq get libssl.so from root conda "/opt/common/external/anaconda/2.3.0" instead of the activate conda "/home/svc_tpmdb_research/.conda/envs/py36an440"? Is pyq using a specific env variable for those conda prefix? Conda keeps changing their prefix env. The CONDA_PREFIX is something newly added. Our conda version is older, so I think this is why I don't have this env variable set. |
It is strange that you see anything because "Import" should start with a lower-case "I". (It's my fault - I made this mistake in my comment.) |
Did you try installing our conda package as I suggested above? Even if you decide to proceed with your own build, it will be good to know if a standard install works. |
okay. I just did that and get the following error. pyq: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by pyq) |
Thanks for trying. It looks like you have a rather old system. What is the output of ldd --version ? We should probably recompile our conda packages to lower the required glibc version. |
Thank you for your help. my version. |
in the meantime, how do I revert back to my working pyq before? |
conda uninstall kdb # should uninstall both q and pyq
pip install pyq |
@jljs Thanks for the info. Please try again to install PyQ from conda. conda uninstall pyq
conda install -c enlnt -c kx pyq This will installl PyQ and kdb+ 3.6 for you. |
Thank you for your help. I'm getting a new error when running pyq now.
|
Sorry, could you please explain why I need to get ondemand license? I'll get our kdb admin to do it shortly. |
@jljs it looks like you have old kdb+ installation. Please check when you run |
You need kdb+ version >= 3.5 in order to use pyq from conda. If you follow our instructions, you should get kdb on demand v. 3.6, but you should only use it on your personal computer. Since you have a kdb admin, you should probably ask them to handle pyq installation. |
I have resolved my issue above by setting LD_LIBRARY_PATH to include conda's virtual env path. I think the current version of pyq may not have correctly setup to use the conda environment properly. Hopefully the new version mentioned above can fix this. I can not verify this right now, as I can only use kdb verserion 3.4. Thank you for your help |
Hi,
I am getting a ssl import error when importing _ssl using PyQ. Please see the error below.
import _ssl
ImportError: /lib/python3.6/lib-dynload/_ssl.cpython-36m-x86_64-linux-gnu.so: undefined symbol: SSL_CTX_set_alpn_protos
I don't have the same issue if I were to use Python executable directly to run my code while keeping all environment variable the same. Are you seeing the same issue in the past? Just wondering if any SSL library is overridden in PyQ?
Thanks
Jeffrey
The text was updated successfully, but these errors were encountered: