gpt4 book ai didi

c++ - Python 3.6 pyrfc 导入错误

转载 作者:行者123 更新时间:2023-12-03 19:39:08 27 4
gpt4 key购买 nike

我有 VM win7 x64、Python 3.6,我正在尝试安装 pyrfc SAP 连接器。
我已经安装了 NWR​​FC 库,将它设置在 PATH 变量中,使用 easy_install 安装了 egg pyrfc-1.9.5-py3.5,并安装了 Visual c++ redistributable 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:\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.

在同一台机器上,我也有 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上有issues与此相关,有些人通过以下方式解决了这个问题:
一人 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.


另一个人 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.

关于c++ - Python 3.6 pyrfc 导入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42718196/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com