Marko Zadravec
Marko Zadravec

Reputation: 8730

Install NWRFC with PyRFC in Windows

I am trying to install PyRFC with NWRFC SAP library... After a lot of work, and problems, I install everything, but now when I start python

import pyrfc

I get

 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "C:\Users\MARKOZ~1\Desktop\p36env\lib\site-packages\pyrfc-1.9.7-py3.6-win-amd64.egg\pyrfc\__init__.py", line 22, in <module>
     from pyrfc._pyrfc import get_nwrfclib_version, Connection, TypeDescription, FunctionDescription, Server
 ImportError: DLL load failed: The specified module could not be found.

In this link I found that I should try to launch rfcexec.exe

After the SAP NW RFC Library installed on Windows system and lib subfolder added to path, you may start the rfcexec.exe test program, from the bin subfolder, to verify the SAP NW RFC Lib installation.

But when I check in this folder I can see rfcexec file but not rfcexec.exe ( and yes, I check if extensions are shown)

I also found that this error could be produced by not have this library in path

Obviously put another path in if your path isn’t C:\Python27\nwrfcsdk\lib If you forget to set the Path, then your Python code won’t be able to use the C-connector and you’ll get an error message: “ImportError: DLL load failed”

So:

I have mwrfcsdk folder with :

-> bin
    |
    -> rfcexec (without exe)
    -> startrfc (without exe)
-> demo
-> doc
-> include
    |
    -> sapdecf.h
    -> sapnwrfc.h
    -> sapuc.h
    -> sapuc.h
    -> sapucx.h
-> lib
    |
    -> libicudata34.a
    -> libicudecnumber.so
    -> libicui18n34.a
    -> libicuuc34.a
    -> libsapnwrfc.so
    -> libsapucum.so
-> META-INF
-> nwrfc750P_0.manifest

I install pyrfc with :

easy_install pyrfc-1.9.7-cp36-cp36m-win_amd64.whl

What do I miss?

EDIT:


I found this page : link where I can see, that when unsar from .sar file I don't get the same print in cmd.... do anyone know why

SAPCAR: processing archive NWRFC_48-20004559.SAR (version 2.01)
x nwrfcsdk
x nwrfcsdk/bin
x nwrfcsdk/bin/rfcexec
x nwrfcsdk/bin/startrfc
x nwrfcsdk/demo
x nwrfcsdk/demo/companyClient.c
x nwrfcsdk/demo/readme.txt
x nwrfcsdk/demo/rfcexec.cpp
x nwrfcsdk/demo/rfcexec.h
x nwrfcsdk/demo/sapnwrfc.ini
x nwrfcsdk/demo/sflightClient.c
x nwrfcsdk/demo/sso2sample.c
x nwrfcsdk/demo/startrfc.cpp
x nwrfcsdk/demo/startrfc.h
x nwrfcsdk/demo/stfcDeepTableServer.c
x nwrfcsdk/doc
x nwrfcsdk/include
x nwrfcsdk/include/sapdecf.h
x nwrfcsdk/include/sapnwrfc.h
x nwrfcsdk/include/sapuc.h
x nwrfcsdk/include/sapucx.h
x nwrfcsdk/lib
x nwrfcsdk/lib/libicudata34.a
x nwrfcsdk/lib/libicudecnumber.so
x nwrfcsdk/lib/libicui18n34.a
x nwrfcsdk/lib/libicuuc34.a
x nwrfcsdk/lib/libsapnwrfc.so
x nwrfcsdk/lib/libsapucum.so
x SIGNATURE.SMF
SAPCAR: 29 file(s) extracted

Upvotes: 2

Views: 3887

Answers (1)

mikewolfli
mikewolfli

Reputation: 343

it shows that you are lack of dll files. And you can get the nwrfcsdk at this link: [SAP nwrfcsdk 7.2][1] [1]: https://github.com/mikewolfli/sapnwrfcsdk After that you can follow the pyrfc installation :

Windows

  1. Create an directory, e.g. c:\nwrfcsdk.
  2. Unpack the SAR archive to it, e.g. c:\nwrfcsdk\lib shall exist.
  3. Include the lib directory to the library search path on Windows, i.e. extend the PATH environment variable.

Then, you can use the pyrfc

import pyrfc

Upvotes: 1

Related Questions