PyRFC icon indicating copy to clipboard operation
PyRFC copied to clipboard

Cannot call Connection from the pyrfc import or any other object

Open guicastello opened this issue 1 year ago • 7 comments

Describe the bug I'm trying to implement pyrfc in my python project, but after all the installations of the library, and the nw rfc sdk package, I can't call the connection through import. I've seen some, if not all, of the issues with related problems and they say to use pip install pynwrfc, but I've also seen on https://pypi.org/project/pynwrfc/ that it's been yanked. So I really don't understand what to do. The issue I saw was from 2020, should I use what pynwrfc or pyrfc? Can you help me, please?

To Reproduce I've done the installations that README.md tells me to, and I've tried to start coding.

Screenshots image

Environment

  • OS: Linux Ubuntu 22.04
  • Running in docker? No
  • PyRFC version: 3.3.1
  • Cython version:3.0.8
  • Installed NWRFCSDK in folder /usr/local/sap/nwrfcsdk
  • Set SAPNWRFC_HOME variable to path = /usr/local/sap/nwrfcsdk

guicastello avatar Feb 26 '24 21:02 guicastello

pynwrfc is obsolete and not supported. Uninstall that package first.

SAP NW RFC SDK libraries must be registered on Linux. Either add /usr/local/sap/nwrfcsdk/lib to LD_LIBRARY_PATH, or use ldconfig, as described in PyRFC documentation: https://sap.github.io/PyRFC/install.html#linux

To verify SAP NW RFC SDK libraries registration, run the RFC SDK version number test:

cd $SAPNWRFC_HOME/bin
./startrfc -v

When it works, PyRFC should work as well.

bsrdjan avatar Feb 27 '24 07:02 bsrdjan

First of all, thank you very much for your help and your comment!

I've added the path to the LD and also checked the SDK version, both work as seen in the images below. However, I still can't find the path to Connection in the code. image image image

I checked that inside my venv where I'm using pyrfc, the _cyrfc file has the .so format. Could it be that I'm not having some kind of error when downloading and transforming this into a py file and that's why I can't import it? Could this have something to do with it? image

guicastello avatar Feb 27 '24 14:02 guicastello

installed pyrfs using

pip3 install pyrfc and another time using pip install pyrfc

same error

image

IsmaelAlvarez avatar Feb 27 '24 15:02 IsmaelAlvarez

The hotifx should not be installed, unless requested by SAP Support. If not requested, please uninstall RFC SDK and install/register PL12, without hotfix.

Then create new virtualenv and run pip install pyrfc there. Just to ensure the pynwrfc leftovers do not cause issues.

The so format is ok, here how it looks in test system

$ cd ...site-packages
$ tree pyrfc
pyrfc
├── _cyrfc.cpython-311-x86_64-linux-gnu.so
├── _exception.py
├── __init__.py
└── _utils.py

bsrdjan avatar Feb 27 '24 16:02 bsrdjan

@IsmaelAlvarez, the error is different, it looks like pyrfc is not installed.

Is it listed in pip freeze or pip list output?

bsrdjan avatar Feb 27 '24 16:02 bsrdjan

@IsmaelAlvarez, the error is different, it looks like pyrfc is not installed.

Is it listed in pip freeze or pip list output?

it does show image

IsmaelAlvarez avatar Feb 27 '24 16:02 IsmaelAlvarez

@IsmaelAlvarez

no idea yet. Could you please open new issue because the symptom is different and provide requested info on platform, python, sdk

bsrdjan avatar Feb 27 '24 17:02 bsrdjan