Comments (9)
Finally got installed pyrfc 3.3.
- Missed packages:
dnf install gcc-c++
# python v3.9.7 installed
dnf install python39-devel
- pip upgrade needed
[root@useazsbxss199 sap_installers]# pip3 install --upgrade pip
(...)
Successfully installed pip-23.2.1
and finally got a successful installation of pyrfc:
[root@useazsbxss199 sap_installers]# pip3 install pyrfc --user
Collecting pyrfc
Using cached pyrfc-3.3.tar.gz (352 kB)
(...)
Successfully installed pyrfc-3.3
Unfortunately we still not have a working pyrfc:
[root@useazsbxss199 sap_installers]# python
Python 3.9.7 (default, Jun 14 2023, 09:39:13)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-10)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyrfc import Connection
libsapnwrfc.so: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Connection' from 'pyrfc' (/root/.local/lib/python3.9/site-packages/pyrfc/__init__.py)
>>>
Moving to a user, we've repeated pyrfc installation and finally have it working but adding a new env variable: LD_LIBRARY_PATH
[cofcoadm@useazsbxss199 ~]$ export LD_LIBRARY_PATH=/tmp/sap_installers/nwrfcsdk/lib
[cofcoadm@useazsbxss199 ~]$ python
Python 3.9.7 (default, Jun 14 2023, 09:39:13)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-10)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyrfc import Connection
>>>
So at this point I understand we have pyrfc properly installed, but still failing in ansible task. But that's subject of another repo.
Thanks !!
from pyrfc.
It fails because pyrfc version 2.8.2 cached source is fetched for some reason and that old version can't be built with newer Cython
Using cached https://files.pythonhosted.org/packages/c2/3f/282b01c8a76da8610b76209ffd825ce999797b7aef2974acbb55ad43ab1d/pyrfc-2.8.2.tar.gz
Which python version is used to run the pyrfc install command? You can try to fix pyrfc version 3.3 in pip install but it should work without it.
Can you also install pyrfc in user space, not root?
from pyrfc.
Hi,
I'm able to fix the installation but still not able to use pyrfc. I'm not sure why we get the files from old version as I've no access to check it. What I've done to install is to simply download the .zip package from this site (PyRFC-main.zip) and unzip in server. From here, just to set the envvar SAPNWRFC_HOME and install:
[root@useazsbxss199 sap_installers]# cd PyRFC-main/
[root@useazsbxss199 PyRFC-main]# pip3 install .
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Processing /tmp/sap_installers/PyRFC-main
Installing collected packages: pyrfc
Running setup.py install for pyrfc ... done
Successfully installed pyrfc-0.0.0
[root@useazsbxss199 PyRFC-main]#
still done as root, we will change it later when fix errors. Why it's showing v0.0.0 ?
Now error is different:
[cofcoadm@useazsbxss199 ~]$ python3
Python 3.6.8 (default, Jun 14 2022, 12:54:58)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-10)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyrfc import *
>>> from pyrfc import Connection
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Connection'
>>>
from pyrfc.
Python 3.6 is not supported PyRFC, see: https://pypi.org/project/pyrfc/
Many Linux systems still use older pre-installed system Python and virtual environment installation is therefore recommended, using pyenv for example. It provides supported Python and avoids running applications as root.
I need to investigate why the installation as you described did not fail with unsupported Python.
from pyrfc.
I've uninstalled python v3.6 ( from our OS image ) and installed v3.9.7. Now I've an error during installation again:
[root@useazsbxss199 sap_installers]# pip3 install pyrfc --user
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting pyrfc
Downloading pyrfc-3.3.tar.gz (352 kB)
|████████████████████████████████| 352 kB 579 kB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: pyrfc
Building wheel for pyrfc (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.9 /usr/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpuc_5ewsl
cwd: /tmp/pip-install-mr87mwzt/pyrfc
Complete output (17 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-39
creating build/lib.linux-x86_64-cpython-39/pyrfc
copying src/pyrfc/__init__.py -> build/lib.linux-x86_64-cpython-39/pyrfc
copying src/pyrfc/_exception.py -> build/lib.linux-x86_64-cpython-39/pyrfc
copying src/pyrfc/_utils.py -> build/lib.linux-x86_64-cpython-39/pyrfc
running build_ext
building 'pyrfc._cyrfc' extension
creating build/temp.linux-x86_64-cpython-39
creating build/temp.linux-x86_64-cpython-39/src
creating build/temp.linux-x86_64-cpython-39/src/pyrfc
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DNDEBUG -D_LARGEFILE_SOURCE -D_CONSOLE -D_FILE_OFFSET_BITS=64 -DSAPonUNIX -DSAPwithUNICODE -DSAPwithTHREADS -DSAPonLIN -I/usr/include/python3.9 -c src/pyrfc/_cyrfc.cpp -o build/temp.linux-x86_64-cpython-39/src/pyrfc/_cyrfc.o -Wall -O2 -fexceptions -funsigned-char -fno-strict-aliasing -Wall -Wno-uninitialized -Wno-deprecated-declarations -Wno-unused-function -Wcast-align -fPIC -pthread -minline-all-stringops -I/tmp/sap_installers/nwrfcsdk/include
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command '/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for pyrfc
Failed to build pyrfc
ERROR: Could not build wheels for pyrfc which use PEP 517 and cannot be installed directly
[root@useazsbxss199 sap_installers]#
from pyrfc.
We're advancing and getting new errors, previous one was probably because an old pip3 version. Upgraded with:
pip3 install --upgrade pip
Now error has changed:
[root@useazsbxss199 sap_installers]# pip3 install pyrfc --user
Collecting pyrfc
Using cached pyrfc-3.3.tar.gz (352 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyrfc
Building wheel for pyrfc (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pyrfc (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [17 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-39
creating build/lib.linux-x86_64-cpython-39/pyrfc
copying src/pyrfc/__init__.py -> build/lib.linux-x86_64-cpython-39/pyrfc
copying src/pyrfc/_exception.py -> build/lib.linux-x86_64-cpython-39/pyrfc
copying src/pyrfc/_utils.py -> build/lib.linux-x86_64-cpython-39/pyrfc
running build_ext
building 'pyrfc._cyrfc' extension
creating build/temp.linux-x86_64-cpython-39
creating build/temp.linux-x86_64-cpython-39/src
creating build/temp.linux-x86_64-cpython-39/src/pyrfc
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DNDEBUG -D_LARGEFILE_SOURCE -D_CONSOLE -D_FILE_OFFSET_BITS=64 -DSAPonUNIX -DSAPwithUNICODE -DSAPwithTHREADS -DSAPonLIN -I/usr/include/python3.9 -c src/pyrfc/_cyrfc.cpp -o build/temp.linux-x86_64-cpython-39/src/pyrfc/_cyrfc.o -Wall -O2 -fexceptions -funsigned-char -fno-strict-aliasing -Wall -Wno-uninitialized -Wno-deprecated-declarations -Wno-unused-function -Wcast-align -fPIC -pthread -minline-all-stringops -I/tmp/sap_installers/nwrfcsdk/include
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command '/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyrfc
Failed to build pyrfc
ERROR: Could not build wheels for pyrfc, which is required to install pyproject.toml-based projects
from pyrfc.
Something is apparently wrong with C++ development toolchain on your system. Cython transforms the Cython source to C++ and C++ compiler required to build.
error: command '/bin/gcc' failed with exit code 1
Perhaps this helps: https://access.redhat.com/solutions/1137503 but I have no access.
Here how the toolchain is installed on Ubuntu system, used in PyRFC testing: https://github.com/SAP/fundamental-tools/blob/main/docker/ubuntu-qa.Dockerfile#L22
from pyrfc.
from pyrfc.
Added the note IN README about Linux https://github.com/SAP/PyRFC#linux, to help other users with similar issues
from pyrfc.
Related Issues (20)
- pyrfc._exception.ExternalRuntimeError: 13 (rc=13): key=RFC_INVALID_HANDLE, caused due to a table parameter without column filed? HOT 3
- ImportError: cannot import name 'Connection' on Suse Linux HOT 3
- Connot establish a connection: RFC_COMMUNICATION_FAILURE & Connection refused HOT 4
- paths_fix.sh fails HOT 1
- BW Query with Parameters - ERROR: IVALID INPUT HOT 2
- [rl-license_file-2] Violation against OSS Rules of Play
- [rl-reuse_tool-2] Violation against OSS Rules of Play
- [rl-reuse_tool-4] Violation against OSS Rules of Play
- timeout halting main thread exit HOT 1
- Creation of sapuc standard filebuf failed HOT 4
- IIS: module 'pyrfc' has no attribute 'Connection' HOT 2
- Is there an equivalent to Java sapidoc3.jar HOT 2
- Cannot call Connection from the pyrfc import or any other object HOT 7
- Failed to compile under Raspberry Pi Bookworm (unrecognized command-line option ‘-minline-all-stringops’) HOT 3
- How to solve key=RFC_COMMUNICATION_FAILURE issue?! HOT 1
- Module 'pyrfc' has no attribute Connection HOT 3
- The connection works with other systems, but this system has several internal RFC destinations." HOT 1
- Enhance Query Engine
- PyRFC failing in server example server_app_thread.py
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyrfc.