Friday, March 6, 2020

pip3 install ovirt-engine-sdk-python 4.4.1 - import ovirtsdk4 errors with pycurl link-time SSL backend was nss and not openssl

In [2]: import ovirtsdk4
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-a16e77aea3e7> in <module>
----> 1 import ovirtsdk4

~/python3env/lib/python3.6/site-packages/ovirtsdk4/__init__.py in <module>
     20 import json
     21 import os
---> 22 import pycurl
     23 import re
     24 import six

ImportError: pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (none/other)

In [3]:



# this was because of pycurl 


####################
# Workaround
####################

pip3 uninstall pycurl 

export PYCURL_SSL_LIBRARY=nss

pip3 install pycurl 


# After that import of pycurl and ovirtsdk4 was successful

# python -c "import pycurl"
# python -c "import ovirtsdk4"

ImportError: pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend

(python3env) [sujit.kumar@terraform python3env]$ python
Python 3.6.8 (default, Aug  7 2019, 17:28:10)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycurl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (openssl)
>>>
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>> exit()



######################
My pycurl was built with nss and pip3 install was compiling this with openssl 


#########
# Workaround
############

pip3 uninstall pycurl 


export PYCURL_SSL_LIBRARY=nss

pip3 install pycurl 


############
# import of pycurl was fine

# python -c "import pycurl"

pip3 install ovirt-engine-sdk-python 4.4.1 - import ovirtsdk4 errors with pycurl link-time SSL backend was nss and not openssl

In [2]: import ovirtsdk4 --------------------------------------------------------------------------- ImportError                         ...