graal icon indicating copy to clipboard operation
graal copied to clipboard

Initial install errors

Open novos40 opened this issue 2 years ago • 4 comments

Describe GraalVM and your environment :

  • GraalVM version or commit id if built from source: not yet installed
  • CE or EE: I don't know what this is
  • JDK version: JDK17
  • OS and OS Version: Fedora linux 39 KDE Plasma
  • Architecture: amd64
  • The output of java -Xinternalversion: OpenJDK 64-Bit Server VM (17.0.7+4-jvmci-23.0-b10) for linux-amd64 JRE (17.0.7+4-jvmci-23.0-b10), built on Mar 24 2023 22:17:53 by "buildslave" with gcc 10.3.0

Have you verified this issue still happens when using the latest snapshot? You can find snapshot builds here: https://github.com/graalvm/graalvm-ce-dev-builds/releases Looking to install a stable version of graalpy

Describe the issue I'm a first-time linux user I'm simply trying to follow the installation steps from https://www.graalvm.org/latest/reference-manual/python/ I've tried both pyenv and conda. Both are failing seemingly for the same reason: can't find posix library. However I can find libposix.so in multiple locations in my system. What am I doing wrong and how to fix this?

Code snippet or code repository that reproduces the issue

N/A

Steps to reproduce the issue On Linux Fedora 39 folow installation steps from follow the installation steps from https://www.graalvm.org/latest/reference-manual/python/

Expected behavior graalpy virtual environment created

Additional context Add any other context about the problem here. Specially important are stack traces or log output. Feel free to link to gists or to screenshots if necesary python-build.20240219234059.26538.log

Tried both: 1) pyenv install graalpy-23.1.2 -- build failed 2) installed graalpy via conda, graalpy -m venv graalpy -- failed to create environment
command: pyenv install graalpy-23.1.2
pyenv build log file
--------------------------------
/tmp/python-build.20240219234059.26538 ~
HTTP/2 404 
server: GitHub.com
content-type: text/html; charset=utf-8
permissions-policy: interest-cohort=()
access-control-allow-origin: *
etag: "64d39a40-24a3"
content-security-policy: default-src 'none'; style-src 'unsafe-inline'; img-src data:; connect-src 'self'
x-proxy-cache: MISS
x-github-request-id: 5028:2966F5:3A3A34:54352A:65D45789
accept-ranges: bytes
date: Tue, 20 Feb 2024 07:40:58 GMT
via: 1.1 varnish
age: 0
x-served-by: cache-pao-kpao1770070-PAO
x-cache: MISS
x-cache-hits: 0
x-timer: S1708414859.697386,VS0,VE85
vary: Accept-Encoding
x-fastly-request-id: 8f2bf72e35f296da7cc6ef3c12ebfbd65e396815
content-length: 9379

/tmp/python-build.20240219234059.26538/graalpy-23.1.2 /tmp/python-build.20240219234059.26538 ~
ERROR: java.lang.UnsupportedOperationException: Could not load posix support library from path '/home/oleg/.pyenv/versions/graalpy-23.1.2/lib/graalpy23.1/libposix.so'. Troubleshooting: 
Check permissions of the file.
Missing runtime Maven dependency 'org.graalvm.truffle:truffle-nfi-libffi' (should be a dependency of `org.graalvm.polyglot:python{-community}`)?
org.graalvm.polyglot.PolyglotException: java.lang.UnsupportedOperationException: Could not load posix support library from path '/home/oleg/.pyenv/versions/graalpy-23.1.2/lib/graalpy23.1/libposix.so'. Troubleshooting: 
Check permissions of the file.
Missing runtime Maven dependency 'org.graalvm.truffle:truffle-nfi-libffi' (should be a dependency of `org.graalvm.polyglot:python{-community}`)?
	at com.oracle.graal.python.runtime.NFIPosixSupport$InvokeNativeFunction.loadLibrary(NFIPosixSupport.java:371)
	at com.oracle.graal.python.runtime.NFIPosixSupport$InvokeNativeFunction.call(NFIPosixSupport.java:305)
	at com.oracle.graal.python.runtime.NFIPosixSupport$InvokeNativeFunction.callLong(NFIPosixSupport.java:320)
	at com.oracle.graal.python.runtime.NFIPosixSupport.lseek(NFIPosixSupport.java:617)
	at com.oracle.graal.python.runtime.NFIPosixSupportGen$PosixSupportLibraryExports$Uncached.lseek(NFIPosixSupportGen.java:6097)
	at com.oracle.graal.python.runtime.ImageBuildtimePosixSupport.lseek(ImageBuildtimePosixSupport.java:258)
	at com.oracle.graal.python.runtime.ImageBuildtimePosixSupportGen$PosixSupportLibraryExports$Uncached.lseek(ImageBuildtimePosixSupportGen.java:2330)
	at com.oracle.graal.python.runtime.PosixSupportLibraryGen$UncachedDispatch.lseek(PosixSupportLibraryGen.java:6808)
	at com.oracle.graal.python.builtins.modules.io.FileIOBuiltins$SeekNode.internalSeek(FileIOBuiltins.java:813)
	at com.oracle.graal.python.builtins.modules.io.FileIOBuiltins$TellNode.internalTell(FileIOBuiltins.java:838)
	at com.oracle.graal.python.builtins.modules.io.AbstractBufferedIOBuiltins$BufferedInitNode.internalInit(AbstractBufferedIOBuiltins.java:120)
	at com.oracle.graal.python.builtins.modules.io.BufferedReaderBuiltins$BufferedReaderInit.internalInit(BufferedReaderBuiltins.java:103)
	at com.oracle.graal.python.builtins.modules.SysModuleBuiltins.initStd(SysModuleBuiltins.java:724)
	at com.oracle.graal.python.builtins.modules.SysModuleBuiltins.postInitialize(SysModuleBuiltins.java:708)
	at com.oracle.graal.python.builtins.Python3Core.postInitialize(Python3Core.java:962)
	at com.oracle.graal.python.runtime.PythonContext.patch(PythonContext.java:1458)
	at com.oracle.graal.python.PythonLanguage.patchContext(PythonLanguage.java:404)
	at com.oracle.graal.python.PythonLanguage.patchContext(PythonLanguage.java:134)
	at org.graalvm.truffle/com.oracle.truffle.api.LanguageAccessor$LanguageImpl.patchEnvContext(LanguageAccessor.java:431)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotLanguageContext.patch(PolyglotLanguageContext.java:893)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.patch(PolyglotContextImpl.java:3478)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotEngineImpl.loadPreinitializedContext(PolyglotEngineImpl.java:1909)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotEngineImpl.createContext(PolyglotEngineImpl.java:1789)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotEngineDispatch.createContext(PolyglotEngineDispatch.java:152)
	at org.graalvm.polyglot/org.graalvm.polyglot.Context$Builder.build(Context.java:1937)
	at com.oracle.graal.python.shell.GraalPythonMain.launch(GraalPythonMain.java:694)
	at com.oracle.graal.python.enterprise.shell.GraalPythonEnterpriseMain.launch(GraalPythonEnterpriseMain.java:53)
	at org.graalvm.launcher.AbstractLanguageLauncher.launch(AbstractLanguageLauncher.java:296)
	at org.graalvm.launcher.AbstractLanguageLauncher.launch(AbstractLanguageLauncher.java:121)
	at org.graalvm.launcher.AbstractLanguageLauncher.runLauncher(AbstractLanguageLauncher.java:168)
	Suppressed: Attached Guest Language Frames (0)
Internal GraalVM error, please report at https://github.com/oracle/graal/issues/.
-----------------------------------------------
command: graalpy -m venv graalpy
terminal output
 ----------------------------------
Traceback (most recent call last):
com.oracle.truffle.api.CompilerDirectives$ShouldNotReachHere: Unable to load native posix support library
--------------------------------------

novos40 avatar Feb 21 '24 05:02 novos40

If it helps here is the log from conda:

[python::Python3Core] FINE: Initial locations:
	Language home: /home/oleg/.conda/envs/graalpy/lib/jvm/languages/python
	SysPrefix: 
	BaseSysPrefix: 
	CoreHome: 
	StdLibHome: 
	CAPI: 
	JNI library: 
[python::Python3Core] FINE: Updated locations:
	Language home: /home/oleg/.conda/envs/graalpy/lib/jvm/languages/python
	SysPrefix: /home/oleg/.conda/envs/graalpy/lib/jvm/languages/python
	BaseSysPrefix: /home/oleg/.conda/envs/graalpy/lib/jvm/languages/python
	CoreHome: /home/oleg/.conda/envs/graalpy/lib/jvm/languages/python/lib/graalpy23.0
	StdLibHome: /home/oleg/.conda/envs/graalpy/lib/jvm/languages/python/lib/python3.10
	Executable: /home/oleg/.conda/envs/graalpy/bin/graalpy
	CAPI: /home/oleg/.conda/envs/graalpy/lib/jvm/languages/python/lib/graalpy23.0
	JNI library: /home/oleg/.conda/envs/graalpy/lib/jvm/languages/python/lib/graalpy23.0
[python::LoggingPosixSupport] INFO: Using class com.oracle.graal.python.runtime.NFIPosixSupport
[python::LoggingPosixSupport] FINER: hasGetpwentries -> return true
[python::GraalPythonModuleBuiltins] FINE: Setting default stdio encoding to utf-8:surrogateescape
[python::Python3Core] FINE: import '_frozen_importlib' # <frozen>
[python::Python3Core] FINE: import '_frozen_importlib_external' # <frozen>
[python::Python3Core] FINE: # installing zipimport hook
[python::Python3Core] FINE: import 'zipimport' # <frozen>
[python::Python3Core] FINE: # installed zipimport hook
[python::Python3Core] FINE: import 'builtins' # <frozen>
[python::Python3Core] FINE: import '__graalpython__' # <frozen>
[python::Python3Core] FINE: import '_weakref' # <frozen>
[python::Python3Core] FINE: import 'bytearray' # <frozen>
[python::Python3Core] FINE: import 'unicodedata' # <frozen>
[python::Python3Core] FINE: import '_sre' # <frozen>
[python::Python3Core] FINE: import 'function' # <frozen>
[python::Python3Core] FINE: import '_sysconfig' # <frozen>
[python::Python3Core] FINE: import 'java' # <frozen>
[python::Python3Core] FINE: import 'pip_hook' # <frozen>
[python::Python3Core] FINE: import '_struct' # <frozen>
[python::LoggingPosixSupport] FINEST: getBackend()
[python::LoggingPosixSupport] FINEST: getBackend -> return 'native'
[python::LoggingPosixSupport] FINER: lseek(0, 0, 1)
[python::NFIPosixSupport] FINE: Loading native library: load (RTLD_LOCAL) "/home/oleg/.conda/envs/graalpy/lib/jvm/languages/python/lib/graalpy23.0/libposix.graalpy230-310-native-x86_64-linux.so"


The library above is present in the file system so I'm at a loss of what is wrong here The terminal output:

Traceback (most recent call last):
com.oracle.truffle.api.CompilerDirectives$ShouldNotReachHere: Unable to load native posix support library


novos40 avatar Feb 23 '24 04:02 novos40

You may need to install the libxcrypt library that is required for the GraalPy native runtime: yum install libxcrypt-compat.

timfel avatar May 22 '24 12:05 timfel

IntelliJ IDEA from Flathub uses org.freedesktop.Sdk/x86_64/23.08 runtime and doesn't include legacy xcrypt. I think graal should upgrade the xcrypt requirements.

cristatus avatar Jul 17 '24 13:07 cristatus

FWIW, I ran into exactly this error on Fedora. The error message was not obvious as to what was wrong. Installing the libxcrypt-compat dependency (yum install libxcrypt-compat) worked for me. Thanks for the suggestion!

laserjim avatar Aug 17 '24 05:08 laserjim

You may need to install the libxcrypt library that is required for the GraalPy native runtime: yum install libxcrypt-compat.

It worked for me too, after I got the following error when trying to run python on my terminal:

org.graalvm.polyglot.PolyglotException: com.oracle.truffle.api.CompilerDirectives$ShouldNotReachHere: Unable to load native posix support library
        at org.graalvm.truffle/com.oracle.truffle.api.CompilerDirectives.shouldNotReachHere(CompilerDirectives.java:574)
        at com.oracle.graal.python.runtime.NFIPosixSupport$InvokeNativeFunction.loadLibrary(NFIPosixSupport.java:337)
        at com.oracle.graal.python.runtime.NFIPosixSupport$InvokeNativeFunction.call(NFIPosixSupport.java:277)
        at com.oracle.graal.python.runtime.NFIPosixSupport$InvokeNativeFunction.callLong(NFIPosixSupport.java:292)
        at com.oracle.graal.python.runtime.NFIPosixSupport.lseek(NFIPosixSupport.java:579)
        at com.oracle.graal.python.runtime.NFIPosixSupportGen$PosixSupportLibraryExports$Uncached.lseek(NFIPosixSupportGen.java:3511)
        at com.oracle.graal.python.runtime.PosixSupportLibraryGen$UncachedDispatch.lseek(PosixSupportLibraryGen.java:6106)
        at com.oracle.graal.python.builtins.modules.io.FileIOBuiltins$SeekNode.internalSeek(FileIOBuiltins.java:803)
        at com.oracle.graal.python.builtins.modules.io.FileIOBuiltins$TellNode.internalTell(FileIOBuiltins.java:828)
        at com.oracle.graal.python.builtins.modules.io.AbstractBufferedIOBuiltins$BufferedInitNode.internalInit(AbstractBufferedIOBuiltins.java:119)
        at com.oracle.graal.python.builtins.modules.io.BufferedReaderBuiltins$BufferedReaderInit.internalInit(BufferedReaderBuiltins.java:96)
        at com.oracle.graal.python.builtins.modules.SysModuleBuiltins.initStd(SysModuleBuiltins.java:661)
        at com.oracle.graal.python.builtins.modules.SysModuleBuiltins.postInitialize(SysModuleBuiltins.java:644)
        at com.oracle.graal.python.builtins.Python3Core.postInitialize(Python3Core.java:932)
        at com.oracle.graal.python.runtime.PythonContext.initialize(PythonContext.java:1314)
        at com.oracle.graal.python.PythonLanguage.initializeContext(PythonLanguage.java:401)
        at com.oracle.graal.python.PythonLanguage.initializeContext(PythonLanguage.java:135)
        at org.graalvm.truffle/com.oracle.truffle.api.TruffleLanguage$Env.postInit(TruffleLanguage.java:3514)
        at org.graalvm.truffle/com.oracle.truffle.api.LanguageAccessor$LanguageImpl.postInitEnv(LanguageAccessor.java:280)
        at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotLanguageContext.ensureInitialized(PolyglotLanguageContext.java:710)
        at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.eval(PolyglotContextImpl.java:1468)
        at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextDispatch.eval(PolyglotContextDispatch.java:63)
        at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:399)
        at com.oracle.graal.python.shell.GraalPythonMain.evalInternal(GraalPythonMain.java:1069)
        at com.oracle.graal.python.shell.GraalPythonMain.launch(GraalPythonMain.java:656)
        at org.graalvm.launcher.AbstractLanguageLauncher.launch(AbstractLanguageLauncher.java:296)
        at org.graalvm.launcher.AbstractLanguageLauncher.launch(AbstractLanguageLauncher.java:121)
        at org.graalvm.launcher.AbstractLanguageLauncher.runLauncher(AbstractLanguageLauncher.java:168)
Caused by: java.lang.UnsatisfiedLinkError: libcrypt.so.1: no se puede abrir el fichero del objeto compartido: No existe el fichero o el directorio
Internal GraalVM error, please report at https://github.com/oracle/graal/issues/.

CamiloMartinezM avatar Feb 24 '25 11:02 CamiloMartinezM