4

I have VM win7 x64, Python 3.6 and I'm trying to install pyrfc SAP connector.

I have installed NWRFC library, set it in PATH variable, installed egg pyrfc-1.9.5-py3.5 with easy_install, and installed Visual c++ redistributable 2015 (x64) 14. But import always fails:

Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

>>> import pyrfc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36\lib\site-packages\pyrfc-1.9.5-py3.5-win-amd64.egg\pyrfc\__init__.py", line 22, in <module>
    from pyrfc._pyrfc import get_nwrfclib_version, Connection, TypeDescription, FunctionDescription, Server
  File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36\lib\site-packages\pyrfc-1.9.5-py3.5-win-amd64.egg\pyrfc\_pyrfc.py", line 7, in <module>
    __bootstrap__()
  File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36\lib\site-packages\pyrfc-1.9.5-py3.5-win-amd64.egg\pyrfc\_pyrfc.py", line 6, in __bootstrap__
    imp.load_dynamic(__name__,__file__)
  File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python36\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

On same machine I have also Python2.7 - its using same NWRFC library and it works with no problem.

    Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import pyrfc
    >>>

What could be the issue? Or how can I trace the import to know which other library is missing?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Yuliya
  • 163
  • 1
  • 2
  • 6

2 Answers2

2

On github there are issues related to this, and some people solved it by:

One person reinstalled SAP SDK:

after some troubleshooting at least in my case was fixed after I re-downloaded the SAP SDK making sure I was downloading the Windows version.

Another person said:

If I uninstall pyrfc v2.0.1 and reinstall v1.9.93 using pyrfc-1.9.93-cp37-cp37m-win_amd64.whl, it works even without needing env var SAPNWRFC_HOME.

LFP
  • 51
  • 3
0

Try:

pip install pyrfc

It works for me.

blackgreen
  • 34,072
  • 23
  • 111
  • 129
Kunal Burangi
  • 568
  • 6
  • 16