2024-01-24 14:29:31 +08:00
|
|
|
use std::env;
|
|
|
|
|
|
|
|
// 指定 pyo3 的绑定对象
|
|
|
|
fn pyo3_config() {
|
|
|
|
// PYO3_PYTHON=xxxx
|
|
|
|
#[cfg(windows)]
|
|
|
|
{
|
|
|
|
env::set_var("PYO3_PYTHON", "python3.10")
|
|
|
|
}
|
|
|
|
// wsl
|
|
|
|
#[cfg(target_os = "linux")]
|
|
|
|
{
|
2024-01-25 22:08:02 +08:00
|
|
|
env::set_var("PYO3_PRINT_CONFIG", "1");
|
|
|
|
env::set_var("PYO3_PYTHON", "/usr/bin/python3.11");
|
2024-01-24 14:29:31 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
pyo3_config();
|
2024-01-24 18:14:50 +08:00
|
|
|
}
|