I am facing the below issue while running a python script from a .NET Core api which is hosted in windows server IIS .I am using pyrfc 1.9.5 SAP connector in this script. Here is the code below
from pyrfc import Connection
def GetConnection(connmeta):
return Connection(**connmeta)
Here is the error which I got -
from pyrfc import Connection
File "<C:\Program Files\Python35\lib\site-packages\pyrfc-1.9.5-py3.5-win-amd64.egg\pyrfc_init_.py>", line 22, in
from pyrfc._pyrfc import get_nwrfclib_version, Connection, TypeDescription, FunctionDescription, Server
ImportError: DLL load failed: The specified module could not be found
It's working fine from the command prompt, python IDLE, Powershell etc. Previously I got this error when the visual c++ redistributable package was not installed. But now it is installed properly as the same script is working from IDLE and Powershell.
Here are the installed software and server details -
- windows server 2016 64 bit
- Visual C++ 2013 redistributable 64 bit
- Python 3.5 64 bit,
- pyrfc 1.9.5 for python 3.5 64 bit (amd64)
- SAP NW RFC SDK 7.5.0 64 bit
Python executable and the path to the lib
folder of the SDK is already added to the Environment variable. I have also tried to execute the sample rfcexec.exe program from the bin
directory it's working fine. I am only getting the error while running the application from IIS. The app pool identity has full permission on the python scripts.
The script is working fine from IIS if I comment the pyrfc import part. Please help .