SAP / PyRFC

Asynchronous, non-blocking SAP NW RFC SDK bindings for Python
http://sap.github.io/PyRFC
Apache License 2.0
515 stars 141 forks source link

pip3 install pyrfc #168

Closed saberabdelhady closed 4 years ago

saberabdelhady commented 4 years ago

i already install on windows 10 C:\Python37>pip3 install pyrfc Collecting pyrfc Downloading pyrfc-0.1.2.tar.gz (3.5 kB) Installing collected packages: pyrfc Running setup.py install for pyrfc ... done Successfully installed pyrfc-0.1.2

but when import i see this issue

Traceback (most recent call last): File "<pyshell#2>", line 1, in from .pyrfc import * ModuleNotFoundError: No module named 'main.pyrfc'; 'main' is not a package

amarvin commented 4 years ago

pyrfc from PyPi is a different module. Try pip install pynwrfc

saberabdelhady commented 4 years ago

image

amarvin commented 4 years ago

See #152

bsrdjan commented 4 years ago

Also the SAP NWRFC SDK installation check in https://github.com/SAP/PyRFC/issues/165#issuecomment-606671429

saberabdelhady commented 4 years ago

1 - i DownloadedSAP NW RFC SDK 7.50 and Visual C++ Redistributable Packages for Visual Studio 2013 image

2- Create the SAP NW RFC SDK home directory, e.g. c:\nwrfcsdk

Set the SAPNWRFC_HOME env variable: SAPNWRFC_HOME=c:\nwrfcsdk

Unpack the SAP NW RFC SDK archive to it, e.g. c:\nwrfcsdk\lib shall exist.

3- install setup.py for windows https://github.com/SAP/PyRFC/releases/tag/2.0.4

pip install Cython python -m pip install -U pip setuptools python -m pip install --upgrade pip

4- pip install pynwrfc --no-binary :all:

image

image image

and i install https://visualstudio.microsoft.com/downloads/ image

image

image

image

saberabdelhady commented 4 years ago

c:\python>pip install pynwrfc Collecting pynwrfc Using cached pynwrfc-2.0.5.tar.gz (236 kB) Requirement already satisfied: setuptools in .\lib\site-packages (from pynwrfc) (41.2.0) Installing collected packages: pynwrfc Running setup.py install for pynwrfc ... error ERROR: Command errored out with exit status 1: command: 'c:\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\support\AppData\Local\Temp\pip-install-xnuuvxu\pynwrfc\setup.py'"'"'; file='"'"'C:\Users\support\AppData\Local\Temp\pip-install-xnuuvxu\pynwrfc\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\support\AppData\Local\Temp\pip-record-6p4crucj\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python\Include\pynwrfc' cwd: C:\Users\support\AppData\Local\Temp\pip-install-xnuuvxu_\pynwrfc\ Complete output (21 lines): 750 Patch Level 6 running install running build running build_py creating build creating build\lib.win32-3.8 creating build\lib.win32-3.8\pyrfc copying src\pyrfc_exception.py -> build\lib.win32-3.8\pyrfc copying src\pyrfc__init__.py -> build\lib.win32-3.8\pyrfc running build_ext building 'pyrfc.pyrfc' extension creating build\temp.win32-3.8 creating build\temp.win32-3.8\Release creating build\temp.win32-3.8\Release\src creating build\temp.win32-3.8\Release\src\pyrfc C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DSAPonNT -D_CRT_NON_CONFORMING_SWPRINTFS -D_CRT_SECURE_NO_DEPRECATES -D_CRT_NONSTDC_NO_DEPRECATE -D_AFXDLL -DWIN32 -D_WIN32_WINNT=0x0502 -DWIN64 -DAMD64 -DNDEBUG -DSAPwithUNICODE -DUNICODE -D_UNICODE -DSAPwithTHREADS -D_ATL_ALLOW_CHAR_UNSIGNED -D_LARGEFILE_SOURCE -D_CONSOLE -DSAP_PLATFORM_MAKENAME=ntintel -Ic:\python\include -Ic:\python\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /EHsc /Tpsrc/pyrfc/_pyrfc.cpp /Fobuild\temp.win32-3.8\Release\src/pyrfc/_pyrfc.obj -Ic:\nwrfcsdk\include -Ic:\python\lib\inspect.py\Include -Ic:\python\lib\inspect.py\Include\PC -EHs -Gy -J -MD -nologo -W3 -Z7 -GL -O2 -Oy- /we4552 /we4700 /we4789 _pyrfc.cpp src/pyrfc/_pyrfc.cpp(25859): warning C4018: '<': signed/unsigned mismatch C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX86\x86\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\python\libs /LIBPATH:c:\python\PCbuild\win32 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x86" sapnwrfc.lib libsapucum.lib /EXPORT:PyInit_pyrfc build\temp.win32-3.8\Release\src/pyrfc/_pyrfc.obj /OUT:build\lib.win32-3.8\pyrfc\pyrfc.cp38-win32.pyd /IMPLIB:build\temp.win32-3.8\Release\src/pyrfc\pyrfc.cp38-win32.lib -LIBPATH:c:\nwrfcsdk\lib -LIBPATH:c:\python\lib\inspect.py\PCbuild -NXCOMPAT -STACK:0x2000000 -SWAPRUN:NET -DEBUG -OPT:REF -DEBUGTYPE:CV,FIXUP -MACHINE:amd64 -nologo -LTCG build\temp.win32-3.8\Release\src\pyrfc_pyrfc.obj : fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64' error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX86\x86\link.exe' failed with exit status 1112

ERROR: Command errored out with exit status 1: 'c:\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\support\AppData\Local\Temp\pip-install-xnuuvxu\pynwrfc\setup.py'"'"'; file='"'"'C:\Users\support\AppData\Local\Temp\pip-install-xnuuvxu\pynwrfc\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\support\AppData\Local\Temp\pip-record-6p4crucj\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python\Include\pynwrfc' Check the logs for full command output.

saberabdelhady commented 4 years ago

thanks now i connect to sap from Ubuntu 18.04

is there any training video to get data from sap

saberabdelhady commented 4 years ago

is there any training video to get data from sap