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

Cannot call Connection from the pyrfc import or any other object #361

Open
guicastello opened this issue Feb 26, 2024 · 7 comments
Open
Assignees
Labels

Comments

@guicastello
Copy link

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
@bsrdjan bsrdjan self-assigned this Feb 27, 2024
@bsrdjan
Copy link
Member

bsrdjan commented Feb 27, 2024

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.

@guicastello
Copy link
Author

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

@IsmaelAlvarez
Copy link

installed pyrfs using

pip3 install pyrfc and another time using pip install pyrfc

same error

image

@bsrdjan
Copy link
Member

bsrdjan commented Feb 27, 2024

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
Copy link
Member

bsrdjan commented Feb 27, 2024

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

Is it listed in pip freeze or pip list output?

@IsmaelAlvarez
Copy link

@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

@bsrdjan
Copy link
Member

bsrdjan commented Feb 27, 2024

@IsmaelAlvarez

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

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

No branches or pull requests

3 participants