0

I have three Linux servers, supposed to be the same. On the first two servers, I managed to install PyRFC, but on the third I got the following error:

 Using cached pyrfc-2.8.2.tar.gz (284 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:

A few lines here...

And then:

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
          self.install_bgrfc_handlers(sysId)

      def install_bgrfc_handlers(self, sysId):
          ucSysId = fillString(sysId)
          cdef RFC_ERROR_INFO errorInfo
          cdef RFC_RC rc = RfcInstallBgRfcHandlers (ucSysId, Server.__onCheckFunction, Server.__onCommitFunction, Server.__onRollbackFunction, Server.__onConfirmFunction, Server.__onGetStateFunction, &errorInfo)
                                                                   ^
  ------------------------------------------------------------

  src/pyrfc/_cyrfc.pyx:1710:65: Cannot assign type 'RFC_RC (RFC_CONNECTION_HANDLE, const RFC_UNIT_IDENTIFIER *) except * nogil' to 'RFC_ON_CHECK_UNIT'

  Error compiling Cython file:

Some lines... And:

  src/pyrfc/_cyrfc.pyx:1762:73: Cannot assign type 'RFC_RC (const SAP_UC *, RFC_ATTRIBUTES, RFC_FUNCTION_DESC_HANDLE *) except * nogil' to 'RFC_FUNC_DESC_CALLBACK'
  Compiling src/pyrfc/_cyrfc.pyx because it changed.
  [1/1] Cythonizing src/pyrfc/_cyrfc.pyx
  Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>

Cython.Compiler.Errors.CompileError: src/pyrfc/_cyrfc.pyx

On the two servers, PyRFC installed properly: I created a Python virtual env with virtualenv and installed the package and everything went OK. On the third server (when I didn’t manage to install PyRFC), I installed the Python virtual env again with virtualenv and even on the virtual env I got the error message as at the root Python.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • 1
    This'll be a package that works with Cython 0.29.x but doesn't yet work on Cython 3. You need to make sure you're using an older Cython version – DavidW Aug 07 '23 at 11:46
  • Hey thank You , I use Cython==0.29.35 on all servers ,.. Do you have more ideas how to solve it please ? – zur_manny Aug 09 '23 at 07:15
  • Add `noexcept` to the function definition. Cython 3 assumes that `cdef` functions can throw exceptions by default while earlier versions of Cython didn't let them throw – DavidW Aug 09 '23 at 07:32
  • where do i do that : "Add noexcept to the function definition" ? if i am using "pip install pyrfc" ? THANK YOU ! – zur_manny Aug 09 '23 at 07:35
  • I missed that the error was in pyrfc, which you don't control. In that case you can't do much except use an early version of Cython or wait for an update to pyrfc – DavidW Aug 09 '23 at 07:48

0 Answers0