SAP / PyRFC

Asynchronous, non-blocking SAP NW RFC SDK bindings for Python
http://sap.github.io/PyRFC
Apache License 2.0
507 stars 134 forks source link

Connection pyrfc module error #315

Closed dcantos1 closed 1 year ago

dcantos1 commented 1 year ago

*I have installed the recommended versions of the wheel, Cython among others to install the pyrfc, I have the SAP SDK seteao in the environment variable SAPNWRFC_HOME=/dbfs/FileStore/nwrfc/nwrfcsdk/ and I install the pyrfc following the steps that are detailed but When I try to use the Connection module, it does not find it and I have reinstalled it and sometimes it gives me the error that appears in the screenshots.

Environment

It installs fine sometimes and gives me this Connection error image

dcantos1 commented 1 year ago

steps: git clone https://github.com/SAP/PyRFC.git cd PyRFC python -m build --wheel --sdist --outdir dist pip install --upgrade --no-index --find-links=dist pyrfc /local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !!

    ********************************************************************************
    Please avoid running ``setup.py`` directly.
    Instead, use pypa/build, pypa/installer, pypa/build or
    other standards-based tools.

    See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
    ********************************************************************************

!! self.initialize_options()

!!

But i have error: image

version image

bsrdjan commented 1 year ago

Setting SAPNWRFC_HOME env variable is enough for building pyrfc. For run-time (ie. from pyrfc import *) SAP NWRFC SDK libraries must be registered on Linux system, like described in "Linux" section here, or using LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SAPNWRFC_HOME/lib

If SAP NWRFC SDK not already registered for runtime, apply on of these methods and re-try.

Here another test, how to check if SAP NWRFC SDK binaries are registered on your system:

cd $SAPNWRFC_HOME/bin
sudo chmod a+x rfcexec
./rfcexec # should show something like:
  Error: Not all mandatory parameters specified
    Please start the program in the following way:
    rfcexec -t -a <program ID> -g <gateway host> -x <gateway service>
     -f <file with list of allowed commands> -s <allowed Sys ID>
  The options "-t" (trace), "-f" and "-s" are optional.
dcantos1 commented 1 year ago

Hello, thank you very much for your comment. I wanted to let you know that it did help me, except for one thing: you made a mistake in the word 'library,' export LD_LIBRARY_PATH=$LD_LIBRRY_PATH:$SAPNWRFC_HOME/lib you missed the 'A.' That's why it wasn't working for me initially, but now everything is okay.

image