i understand a bit more of the problem:
even if pyffi is installed in 'installation' mode but with a link (i the GUI package manager) to the cloned/fork of pyffi in my user dir the web server which another user _www under /Library/Webserver on mac os has no configuration for pyffi for python 3.10 , so i log in _www and do the configuration for him with an python 3.10 virtual environment:
_www@mac ~ % source myvenv3.10/bin/activate
(myvenv3.10) _www@mac ~ % /Applications/Racket/bin/raco pyffi configure
Configuration tool for `pyffi`.
-------------------------------
This tool attempts to find the shared library `libpython3`
with the help of the `python3` executable.
The executable
/Users/mattei/myvenv3.10/bin/python3
will be used to find the location of the shared library.
The previous value of LIBDIR was:
/opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/lib
The preference for LIBDIR is now set to:
/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/lib
The previous value of DATA was:
/Library/WebServer/my-env
The preference for DATA is now set to:
/Users/mattei/myvenv3.10
(myvenv3.10) _www@mac ~ % /Applications/Racket/bin/drracket
2025-12-04 23:21:41.019 DrRacket[11656:102821] +[NSXPCSharedListener endpointForReply:withListenerName:replyErrorCode:]: an error occurred while attempting to obtain endpoint for listener 'ClientCallsAuxiliary': Connection interrupted
Swift/SwiftNativeNSArray.swift:77: Fatal error: Array index out of range
zsh: trace trap /Applications/Racket/bin/drracket
(myvenv3.10) _www@mac ~ % /Applications/Racket/bin/racket
Welcome to Racket v8.18 [cs].
> (require pyffi)
(libpython-path /opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/lib/libpython3.10.dylib)
and then pyffi start well with _www user.
But it again fails when from the apache web server, i suppose it fails because for the scientific code the web server use python3.12 and then at some point pyffi....
> (find-system-path 'pref-file)
(libpython-path /opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/lib/libpython3.10.dylib)
#<path:/Library/WebServer/Library/Preferences/org.racket-lang.prefs.rktd>
ok i understand the problem, under Mac OS ,Racket , if i'm with httpd ran by user _www i got in my logs:
[3] => interpole-fields : Racket/Scheme+ (find-system-path 'pref-file): /Users/mattei/Library/Preferences/org.racket-lang.prefs.rktd
that is Racket do not get pref-file from _www home dir but from mattei home dir.
I think it is a bug in Racket because the doc says:
and pyffi get it by calling:
(get-preference 'pyffi:libdir (λ () #f))
which said : Extracts a preference value from the file designated by (find-system-path 'pref-file),
Racket should use preference file of the user running the process, which is _www, not me (mattei)
update: and it fails because _www has. no right to read my preference file:
open-input-file: cannot open input file
path: /Users/mattei/Library/Preferences/org.racket-lang.prefs.rktd
system error: Permission denied; errno=13
context...:
body of "/opt/homebrew/var/www/drive/interpole_fields"
when i test it from the web server application
so it default to #f of (λ () #f)
which then set it like this :
(define libpython-path
(or (for/first ([name '("libpython3.10" "libpython310" "libpython3")]
#:when (file-exists? (build-full-path name)))
(build-full-path name))
;; Github Action (Ubuntu)
"libpython3.10"))
from source code of pyffi , it fall back to libpython3.10 which is not a full path and cannot be find by dlopen ....