Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DLL load failed: %1 is not a valid Win32 application. #41

Closed
kamalelsaaid opened this issue Mar 30, 2017 · 4 comments
Closed

DLL load failed: %1 is not a valid Win32 application. #41

kamalelsaaid opened this issue Mar 30, 2017 · 4 comments

Comments

@kamalelsaaid
Copy link

kamalelsaaid commented Mar 30, 2017

My problem:
I am trying to contact SAP with python using the PYRFC on windows.
I am using Python3.4 AMD 64 - win 64, and I have followed these instructions web pages. this
and this also
but after I have finished all instructions, I tried to import PYRFC in python, but I got this issue.
My Issue:

ImportError: DLL load failed: %1 is not a valid Win32 application.

(Windows) This error occurs when SAP NW RFC Library 64bit version is installed on a system with 32bit version Python.

I don't know why I got this issues as I am running on a 64bit version python and 64bit version SAP NW RFC Library.
So, Is the problem that I am using python3.4 and this mean I have to use python2.7 or should I change my version to 32bit version instead of 64 ?

@bsrdjan
Copy link
Member

bsrdjan commented Mar 31, 2017

Is Visual C++ Redistributable for Visual Studio 2015 installed, like described in README - recently updated per issue #19 feedback ? Python 3.4 shall work on 64 bit, no need for 32 bit.

@kamalelsaaid
Copy link
Author

kamalelsaaid commented Apr 4, 2017

@bsrdjan Thank you for your response, yes, I have already installed the Visual C++ Redistributable, I have installed the 2015.
What should I do next, I tried many things, is there any another cases that may case this error.
Should I try to run python 32bit and reinstall pyrfc with 32bit

@kamalelsaaid
Copy link
Author

Okay, I found a solution.
I should type the following command as this is the command related to version 64 bit
SAPCAR_315-20010451.EXE -xvf NWRFC_24-20004568.SAR
I am not sure but what I have made is type that command and tried also this command for 32bit version
SAPCAR_315-20010451.EXE -xvf NWRFC_24-20004566.SAR
SAPCAR_315-20010451.EXE -xvf NWRFC_24-20004563.SAR
and it finally worked.

@bsrdjan
Copy link
Member

bsrdjan commented Apr 4, 2017

Glad the issue is solved, these filenames are not easy to deal with.

For such kind of errors, there are test programs in nwrfcsdk/lib folder, like rfcexec.exe for example, to verify that sapnwrfc sdk is correctly installed. The troubleshooting can start from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants