Skip to content
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

unable to import aerospike #214

Closed
tarinders23 opened this issue Apr 28, 2018 · 20 comments
Closed

unable to import aerospike #214

tarinders23 opened this issue Apr 28, 2018 · 20 comments

Comments

@tarinders23
Copy link

After installing python client for aerospike, I am unable to import it.
I am using the openssl 1.1.0g on ubuntu 18.04.


>>> import aerospike
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/local/lib/python3.6/dist-packages/aerospike.cpython-36m-x86_64-linux-gnu.so: undefined symbol: SSLv23_client_method
@aerospikerobertmarks
Copy link
Contributor

Thanks for reporting this, we're looking into the issue.

@aerospikerobertmarks
Copy link
Contributor

Hi @tarinders23, We don't have a perfect solution yet, but are working on it.

For now, I would recommend manually building the C client: https://github.com/aerospike/aerospike-client-c which the Python client depends upon, and then installing the python client:

For safety first remove the current version of the python client, (Assuming it was installed with pip)
pip uninstall aerospike
git clone https://github.com/aerospike/aerospike-client-c.git
cd aerospike-client-c/

Install the dependencies mentioned in the readme for that repo: https://github.com/aerospike/aerospike-client-c#build-prerequisites

git submodule update --init
Build the C client library
make

From the C client directory, pip install the aerospike python client, making sure not to use the cached version.
AEROSPIKE_C_HOME=$PWD DOWNLOAD_C_CLIENT=0 pip install --no-cache-dir aerospike

It's somewhat involved, but it should work. Let me know if the doesn't fix the issue

@aerospikerobertmarks
Copy link
Contributor

With version 3.3.0, released on pip today, installation should work via pip install aerospike on Ubuntu18.

@tarinders23
Copy link
Author

Thank you for the help.

@aerospikerobertmarks
Copy link
Contributor

Thank you for letting us know about the problem, it's always helpful to hear about issues.

@LightAutumnMelancholy
Copy link

Occuring on Fedora 29 on Python 3.x+. I performed the above from @aerospikerobertmarks aerospikerobertmarks, (built from source) but the problem still exists.

in Fedora libssl -> openssl-devel

SSLv23_client_method

I think that there was some depreciation of methods between versions of openssl. Please check that out.

[jon2kx@pc-local checkairospike]$ ./checkairospikedata.py
Traceback (most recent call last):
File "./checkairospikedata.py", line 3, in
import aerospike
ImportError: /usr/local/lib64/python3.7/site-packages/aerospike.cpython-37m-x86_64-linux-gnu.so: undefined symbol: SSLv23_client_method
[jon2kx@pc-local checkairospike]$ rpm -qa openssl*
openssl-1.1.1a-1.fc29.x86_64
openssl-devel-1.1.1a-1.fc29.x86_64
openssl-libs-1.1.1a-1.fc29.x86_64
openssl-pkcs11-0.4.8-2.fc29.x86_64
openssl-static-1.1.1a-1.fc29.x86_64
[jon2kx@pc-local checkairospike]$ uname -a
Linux pc-local 4.20.5-200.fc29.x86_64 #1 SMP Mon Jan 28 19:29:17 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[jon2kx@pc-local checkairospike]$ cat /etc/redhat-release
Fedora release 29 (Twenty Nine)
[jon2kx@pc-local checkairospike]$

@MicahCarrick
Copy link

MicahCarrick commented Feb 8, 2019

@aerospikerobertmarks I can confirm this is still an issue in Fedora 29.

@jon2kx the workaround of compiling the C client and using it in the Python client setup is working for me on Fedora 29. Are you sure you compiled the C client correctly AND did the pip install from the C client directory?

For Python 3 in a virtual environment:

AEROSPIKE_C_HOME=$PWD DOWNLOAD_C_CLIENT=0 pip install --no-cache-dir aerospike

For Python 3 at the system level use pip3 on Fedora:

AEROSPIKE_C_HOME=$PWD DOWNLOAD_C_CLIENT=0 pip3 install --no-cache-dir aerospike

You should see the python setup find the compiled C client you checked out:

CHECK
       [✓] /home/micah/checkout/aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a
       [✓] /home/micah/checkout/aerospike-client-c/target/Linux-x86_64/include/aerospike/aerospike.h

And you should NOT see the python setup using the downloaded C client:

CHECK
       [✓] /tmp/pip-install-ezabxmft/aerospike/aerospike-client-c/package/usr/lib/libaerospike.a
       [✓] /tmp/pip-install-ezabxmft/aerospike/aerospike-client-c/package/usr/include/aerospike/aerospike.h

@LightAutumnMelancholy
Copy link

That worked after all. I'm not sure what happened the first time around, but probably safe to say user error on my part.

@ankur-chouragade
Copy link

Workaround setup is not working for me on CentOS 7.6 for python3.x+ . Tried installing from the c client directory itself but still getting the same error

@LightAutumnMelancholy
Copy link

LightAutumnMelancholy commented Feb 14, 2019 via email

@alon-dotan-starkware
Copy link

any chance to get this issue solved in a better way?
like, push 2 different versions to pip repo?
we use erogenous environments, ubuntu 18.04, arch, latest fedora to build and develop our product, this issue makes the dependency maintenance much more complicated then he need to be...
Thanks,

@marknaero
Copy link
Contributor

With pip (>=19.0) and latest python client (>=3.8.0), you should be able to install on linux without needing to clone the c client or install any other dependencies anymore

Can you please try again with this setup?

@alon-dotan-starkware
Copy link

Hey, @marknaero the issue still exists under Fedora 31
pip: pip 19.3.1 from /home/alond/Sources/starkware2/.tox/dev/lib/python3.7/site-packages/pip (python 3.7)

pip freeze | grep aero
aerospike==3.9.0
Thanks,

@marknaero
Copy link
Contributor

@alon-dotan-starkware Thanks for trying. As Dylan pointed out to me this morning, we don't officially support python 3.7 yet, so we did not update pypi with a 3.7 manylinux2010 wheel. We'll get back to you soon with a possible step to try in the meantime.

@alon-dotan-starkware
Copy link

@marknaero
new issue came up on ubuntu releases with the latest client is undefined symbol: OPENSSL_sk_num...
any chance to get the latest version of aerospike client in the formal pip repo?
Thanks

@dwelch-spike
Copy link
Contributor

The latest version of the python client is uploaded to pip. We are working on official python3.7 support for the client. When it is released, we will post it to the production pip repo.

Thank you for your patience.

@pravin1406
Copy link

Tried installing the python client on my system.
Tried various solutions but nothing seems to work

Collecting aerospike
Using cached https://files.pythonhosted.org/packages/62/e1/b33a0bcbb1f223fecb22bcfa70fd7add740ab96cc6ce1d083f14a429f2ca/aerospike-3.10.0.tar.gz
ERROR: Command errored out with exit status 8:
command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/r8/839_4ptd2pq2c6s1z7gfdvbr0000gp/T/pip-install-4myvi98j/aerospike/setup.py'"'"'; file='"'"'/private/var/folders/r8/839_4ptd2pq2c6s1z7gfdvbr0000gp/T/pip-install-4myvi98j/aerospike/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/r8/839_4ptd2pq2c6s1z7gfdvbr0000gp/T/pip-install-4myvi98j/aerospike/pip-egg-info
cwd: /private/var/folders/r8/839_4ptd2pq2c6s1z7gfdvbr0000gp/T/pip-install-4myvi98j/aerospike/
Complete output (1 lines):
error: OS not supported: macOS-10.14.6-x86_64-i386-64bit
----------------------------------------
ERROR: Command errored out with exit status 8: python setup.py egg_info Check the logs for full command output.

@LightAutumnMelancholy
Copy link

LightAutumnMelancholy commented Feb 13, 2020 via email

@pravin1406
Copy link

Thanks. It works fine with 3.7. I had 3.8.1

@dwelch-spike
Copy link
Contributor

The python client does not officially support python 3.8 yet. The origin of the "OS not supported" error can be seen here #250. You can get around this by manually building and installing the client via these directions.

Since this issue is closed please continue discussion at the open issue #255.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants