You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a best practice for dynamically or statically embedding Python interpreters into Rust binary programs? I have a Rust web service that wants to run some Python snippets submitted by the client, but after adding pyo3:: prepare_freethreaded_python(), I encountered some errors:
1161.9 pyscript_application.da8c04bfd5d8f6e9-cgu.0:(.text._ZN110_$LT$pyscript_engine..rule_engine..node..RuleNodes$u20$as$u20$pyscript_common..rule_engine..node..PyRuleNode$GT$4init17hc7ed8e0f2a4f0950E+0x59d): undefined reference to `Py_CompileStringExFlags'
1161.9 /usr/bin/ld: pyscript_application.da8c04bfd5d8f6e9-cgu.0:(.text._ZN110_$LT$pyscript_engine..rule_engine..node..RuleNodes$u20$as$u20$pyscript_common..rule_engine..node..PyRuleNode$GT$4init17hc7ed8e0f2a4f0950E+0x5ba): undefined reference to `PyImport_ExecCodeModuleEx'
1161.9 /usr/bin/ld: pyscript_application.da8c04bfd5d8f6e9-cgu.0:(.text._ZN110_$LT$pyscript_engine..rule_engine..node..RuleNodes$u20$as$u20$pyscript_common..rule_engine..node..PyRuleNode$GT$4init17hc7ed8e0f2a4f0950E+0x5d1): undefined reference to `PyModule_Type'
1161.9 /usr/bin/ld: pyscript_application.da8c04bfd5d8f6e9-cgu.0:(.text._ZN110_$LT$pyscript_engine..rule_engine..node..RuleNodes$u20$as$u20$pyscript_common..rule_engine..node..PyRuleNode$GT$4init17hc7ed8e0f2a4f0950E+0x5da): undefined reference to `PyModule_Type'
1161.9 /usr/bin/ld: pyscript_application.da8c04bfd5d8f6e9-cgu.0:(.text._ZN110_$LT$pyscript_engine..rule_engine..node..RuleNodes$u20$as$u20$pyscript_common..rule_engine..node..PyRuleNode$GT$4init17hc7ed8e0f2a4f0950E+0x5e0): undefined reference to `PyType_IsSubtype'
1161.9 /usr/bin/ld: pyscript_application.da8c04bfd5d8f6e9-cgu.0:(.text._ZN110_$LT$pyscript_engine..rule_engine..node..RuleNodes$u20$as$u20$pyscript_common..rule_engine..node..PyRuleNode$GT$4init17hc7ed8e0f2a4f0950E+0x9dc): undefined reference to `_Py_Dealloc'
1161.9 /usr/bin/ld: pyscript_application.da8c04bfd5d8f6e9-cgu.0:(.text._ZN110_$LT$pyscript_engine..rule_engine..node..RuleNodes$u20$as$u20$pyscript_common..rule_engine..node..PyRuleNode$GT$4init17hc7ed8e0f2a4f0950E+0xb39): undefined reference to `PyGILState_Release'
1161.9 /usr/bin/ld: pyscript_application.da8c04bfd5d8f6e9-cgu.0:(.text._ZN110_$LT$pyscript_engine..rule_engine..node..RuleNodes$u20$as$u20$pyscript_common..rule_engine..node..PyRuleNode$GT$4init17hc7ed8e0f2a4f0950E+0xc2a): undefined reference to `PyUnicode_FromStringAndSize'
1161.9 /usr/bin/ld: pyscript_application.da8c04bfd5d8f6e9-cgu.0:(.text._ZN110_$LT$pyscript_engine..rule_engine..node..RuleNodes$u20$as$u20$pyscript_common..rule_engine..node..PyRuleNode$GT$4init17hc7ed8e0f2a4f0950E+0xcb3): undefined reference to `_Py_Dealloc'
1161.9 /usr/bin/ld: pyscript_application.da8c04bfd5d8f6e9-cgu.0:(.text._ZN110_$LT$pyscript_engine..rule_engine..node..RuleNodes$u20$as$u20$pyscript_common..rule_engine..node..PyRuleNode$GT$4init17hc7ed8e0f2a4f0950E+0xdae): undefined reference to `PyType_GenericAlloc'
1161.9 /usr/bin/ld: pyscript_application.da8c04bfd5d8f6e9-cgu.0:(.text._ZN110_$LT$pyscript_engine..rule_engine..node..RuleNodes$u20$as$u20$pyscript_common..rule_engine..node..PyRuleNode$GT$4init17hc7ed8e0f2a4f0950E+0xe02): undefined reference to `_Py_Dealloc'
1161.9 collect2: error: ld returned 1 exit status
Rust version: 1.82.0
pyo3 version: pyo3 = { version = "0.22", features = ["extension-module"] }
OS: Debian 12
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is there a best practice for dynamically or statically embedding Python interpreters into Rust binary programs? I have a Rust web service that wants to run some Python snippets submitted by the client, but after adding
pyo3:: prepare_freethreaded_python()
, I encountered some errors:Rust version:
1.82.0
pyo3 version:
pyo3 = { version = "0.22", features = ["extension-module"] }
OS:
Debian 12
Beta Was this translation helpful? Give feedback.
All reactions