Skip to content

Some Python stdlib modules don't import #1308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sgammon opened this issue Mar 17, 2025 · 0 comments · Fixed by #1332
Closed

Some Python stdlib modules don't import #1308

sgammon opened this issue Mar 17, 2025 · 0 comments · Fixed by #1332
Assignees
Labels
bug Something isn't working

Comments

@sgammon
Copy link
Member

sgammon commented Mar 17, 2025

Expected Behavior

  1. Import things like os, sys; it works
  2. Import things like json; should work

Actual Behaviour

  1. Import things like os, sys; it works
  2. Import things like json; there is an error

Stacktrace

ModuleNotFoundError: No module named 'json'
        at org.graalvm.polyglot/org.graalvm.polyglot.Value.throwException(Value.java:1887)
        at elide.tool.cli.cmd.repl.ToolShellCommand.processUserCodeError(ToolShellCommand.kt:920)
        at elide.tool.cli.cmd.repl.ToolShellCommand.beginInteractiveSession$lambda$23$lambda$22(ToolShellCommand.kt:1032)
        at elide.tool.cli.cmd.repl.ToolShellCommand.initCLI(ToolShellCommand.kt:561)
        at elide.tool.cli.cmd.repl.ToolShellCommand.beginInteractiveSession(ToolShellCommand.kt:981)
        at elide.tool.cli.cmd.repl.ToolShellCommand.invoke$lambda$72$lambda$71(ToolShellCommand.kt:1568)
        at elide.tool.cli.AbstractSubcommand.withDeferredContext(AbstractSubcommand.kt:569)
        at elide.tool.cli.cmd.repl.ToolShellCommand.invoke(ToolShellCommand.kt:1536)
        at elide.tool.cli.cmd.repl.ToolShellCommand$invoke$1.invokeSuspend(ToolShellCommand.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:263)
        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
        at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:47)
        at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
        at elide.tool.cli.AbstractToolCommand.call(AbstractToolCommand.kt:292)
        at elide.tool.cli.Elide.invoke-AZeniH0(Elide.kt:393)
        at elide.tool.cli.AbstractToolCommand$call$$inlined$execute$1.invokeSuspend(AbstractToolCommand.kt:185)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:263)
        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
        at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:47)
        at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
        at elide.tool.cli.AbstractToolCommand.call(AbstractToolCommand.kt:292)
        at elide.tool.cli.AbstractToolCommand.call(AbstractToolCommand.kt:55)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2045)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
        at picocli.CommandLine.execute(CommandLine.java:2174)
        at elide.tool.cli.Elide$Companion.entry(Elide.kt:446)
        at elide.tool.cli.MainKt.main(main.kt:239)
        at [email protected]/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)

Steps To Reproduce

See above

Environment Information

  • Operating System: All
  • Architecture: All

Runtime

Native

Language

Python

Example Application

No response

Version

1.0.0-beta1

@sgammon sgammon added the bug Something isn't working label Mar 17, 2025
@sgammon sgammon added this to the Release R16: Beta milestone Mar 17, 2025
@sgammon sgammon self-assigned this Mar 17, 2025
@sgammon sgammon added this to Elide Mar 17, 2025
sgammon added a commit that referenced this issue Mar 24, 2025
fix: don't force stdlib/home paths in image code

Fixes and closes #1308

Signed-off-by: Sam Gammon <[email protected]>
This was linked to pull requests Mar 24, 2025
@github-project-automation github-project-automation bot moved this to Done in Elide Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant