Unable to Import pyrfc in Python in Windows

2k views Asked by At

I am trying to connect python to SAP by calling the Function Module RFC_READ_TABLE. I followed every steps in this link, including setting up the environment variables.

enter image description here

However, when I try to Import Pyrfc, I got an error: ImportError: DLL load failed while importing _pyrfc: The specified procedure could not be found.

enter image description here

If I set PATH=C:\nwrfcsdk\lib;C:\nwrfcsdk\bin;%PATH% manually in CMD Consule, it's working fine,

enter image description here

enter image description here

I have re-started my computer many times. Still the same issue. Could anyone help me? Thank you.

1

There are 1 answers

1
Suncatcher On

Very likely you downloaded the wrong version of PyRFC and that is why it cannot find it in the path:

https://github.com/SAP/PyRFC/issues/152

enter image description here

I got into this trap in the recent past and pulled my hairs out trying to figure out the cause why NWRFC/PyRFC is not recognized on my machine