我有vm win7 x64,python 3.6,我正在尝试安装pyrfc sap connector。
我已经安装了NWRFC库,将其设置在路径变量中,安装了带有Easy_install的Egg Pyrfc-1.9.5-py3.5,并安装了Visual C 重新分布可2015(x64)14。但导入始终失败:
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:UsersADMINAppDataLocalProgramsPythonPython36libsite-packagespyrfc-1.9.5-py3.5-win-amd64.eggpyrfc__init__.py", line 22, in <module>
from pyrfc._pyrfc import get_nwrfclib_version, Connection, TypeDescription, FunctionDescription, Server
File "C:UsersADMINAppDataLocalProgramsPythonPython36libsite-packagespyrfc-1.9.5-py3.5-win-amd64.eggpyrfc_pyrfc.py", line 7, in <module>
__bootstrap__()
File "C:UsersADMINAppDataLocalProgramsPythonPython36libsite-packagespyrfc-1.9.5-py3.5-win-amd64.eggpyrfc_pyrfc.py", line 6, in __bootstrap__
imp.load_dynamic(__name__,__file__)
File "C:UsersADMINAppDataLocalProgramsPythonPython36libimp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
在同一台计算机上,我也有Python2.7-它使用同一NWRFC库,并且无问题。
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
>>>
有什么问题?或我该如何跟踪导入以知道缺少哪些其他库?
在github上有与此相关的问题,有些人解决了:
一个人重新安装了SAP SDK:
在我重新下载SAP SDK后,至少在我的情况下进行了一些故障排除后,确保我正在下载Windows版本。
另一个人说:
如果我卸载了pyrfc v2.0.1并重新安装v1.9.93使用pyrfc-1.9.93-cp37-cp37-cp37m-win_amd64.whl,它即使无需env var sapnwrfc_home也可以工作。
尝试:
pip install pyrfc
它对我有用。