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

GQLAlchemy install fails because of mgclient dependencies #58

Open
antejavor opened this issue Sep 11, 2023 · 4 comments
Open

GQLAlchemy install fails because of mgclient dependencies #58

antejavor opened this issue Sep 11, 2023 · 4 comments
Labels
bug bug community community Effort - High Effort - High Frequency - Monthly Frequency - Monthly Priority - Later Priority - Later Reach - Some Reach - Some Severity - S1 Severity - S1

Comments

@antejavor
Copy link

GQL is hard to install for usage on AWS Lambdas because of the dependencies, probably because OS environment is striped compared to conventional Linux images, so it probably requires a bit more steps.

The user tried to create an identical environment in custom docker image, running amazonlinux:2 :
pip3 install -t python gqlalchamy

First, the typical issues with OpenSSL not being visible popped out:

CMake Error at /usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
  system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY) (found
  version "1.0.2k") 

After installing OpenSSL-static, zlib, and zlib-static, the OpenSSL issue disappeared, and a strange linker failure was hit:

image

The user moved to the Neo4j Python driver.

Full context: https://discord.com/channels/842007348272169002/842338690109931520/1146269544118227054

@katarinasupe
Copy link

Noticed similar when installing GQLAlchemy on Windows with Python 3.11 -> memgraph/gqlalchemy#290

@ad1arsh
Copy link

ad1arsh commented Dec 20, 2023

I would like to add that I am also facing the same issue on an EC2 instance with Amazon linux and a conda environment:

CMake Error at /usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:164 (message): Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY) (found version "3.0.8")

However, after installing OpenSSL-static, zlib, and zlib-static, pymgclient could be installed. However, I am hit with a different error:

image

I feel this is again due to a mismatch in the used OpenSSL package.

I had used this command previously to explicitly define which OpenSSL to use in my conda environment:
CC=clang CXX=clang++ OPENSSL_INCLUDE_DIR=/opt/conda/envs/pytorch/include OPENSSL_ROOT_DIR=/opt/conda/envs/pytorch OPENSSL_LIBRARIES="/opt/conda/envs/pytorch/lib/libssl.so;/opt/conda/envs/pytorch/lib/libcrypto.so" pip install pymgclient --no-cache

Some guidance would be much appreciated on this, as a large part of the workflow relies on pymgclient (I was on an ubuntu server before migrating to AWS), and I would rather avoid the work needed to modify this for the neo4j driver.

These are my specs:

NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3⭕amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
SUPPORT_END="2025-06-30"

@katarinasupe
Copy link

Additional context: import is not working using venv on Amazon Linux 2, so this is not only related to Conda.
Error when trying to import mgclient:
ImportError: /home/ec2-user/biomex/venv/lib/python3.10/site-packages/mgclient.cpython-310-x86_64-linux-gnu.so: undefined symbol: krb5_free_context

cc @ad1arsh

@katarinasupe
Copy link

Here are the steps I recommended @ad1arsh to try:

  1. Uninstall pymgclient anywhere you have it with pip uninstall pymgclient
  2. Create a new clean conda environment and run pip install pymgclient --no-cache (without any prerequisites installed)
  3. Try importing mgclient

User tried this with both Python 3.9 and Python 3.10 envs and it produces the same error as before:
ImportError: /opt/conda/envs/newenv/lib/python3.10/site-packages/mgclient.cpython-310-x86_64-linux-gnu.so: undefined symbol: krb5_free_context

Additional context
When creating a new env, this is what gets installed:

_libgcc_mutex      conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge 
  _openmp_mutex      conda-forge/linux-64::_openmp_mutex-4.5-2_gnu 
  bzip2              conda-forge/linux-64::bzip2-1.0.8-hd590300_5 
  ca-certificates    conda-forge/linux-64::ca-certificates-2023.11.17-hbcca054_0 
  ld_impl_linux-64   conda-forge/linux-64::ld_impl_linux-64-2.40-h41732ed_0 
  libffi             conda-forge/linux-64::libffi-3.4.2-h7f98852_5 
  libgcc-ng          conda-forge/linux-64::libgcc-ng-13.2.0-h807b86a_3 
  libgomp            conda-forge/linux-64::libgomp-13.2.0-h807b86a_3 
  libnsl             conda-forge/linux-64::libnsl-2.0.1-hd590300_0 
  libsqlite          conda-forge/linux-64::libsqlite-3.44.2-h2797004_0 
  libuuid            conda-forge/linux-64::libuuid-2.38.1-h0b41bf4_0 
  libzlib            conda-forge/linux-64::libzlib-1.2.13-hd590300_5 
  ncurses            conda-forge/linux-64::ncurses-6.4-h59595ed_2 
  openssl            conda-forge/linux-64::openssl-3.2.0-hd590300_1 
  pip                conda-forge/noarch::pip-23.3.2-pyhd8ed1ab_0 
  python             conda-forge/linux-64::python-3.10.13-hd12c33a_0_cpython 
  readline           conda-forge/linux-64::readline-8.2-h8228510_1 
  setuptools         conda-forge/noarch::setuptools-68.2.2-pyhd8ed1ab_0 
  tk                 conda-forge/linux-64::tk-8.6.13-noxft_h4845f30_101 
  tzdata             conda-forge/noarch::tzdata-2023c-h71feb2d_0 
  wheel              conda-forge/noarch::wheel-0.42.0-pyhd8ed1ab_0 
  xz                 conda-forge/linux-64::xz-5.2.6-h166bdaf_0

It seems that other similar issues were resolved with the correct version of pymgclient being used, but on Amazon Linux 2 this is potentially not a fix.

cc @as51340 @antoniofilipovic for awareness

@DavIvek DavIvek added Effort - High Effort - High and removed Effort - Unknown Effort - Unknown labels Jan 16, 2024
@hal-eisen-MG hal-eisen-MG added Priority - Later Priority - Later and removed Priority - Later Priority - Later labels Feb 4, 2024
@hal-eisen-MG hal-eisen-MG added Priority - Later Priority - Later and removed Priority - Later Priority - Later labels Feb 18, 2024
@katarinasupe katarinasupe added Frequency - Monthly Frequency - Monthly Reach - Some Reach - Some and removed Importance - I2 Importance - I2 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bug community community Effort - High Effort - High Frequency - Monthly Frequency - Monthly Priority - Later Priority - Later Reach - Some Reach - Some Severity - S1 Severity - S1
Projects
Development

No branches or pull requests

5 participants