pyo3 icon indicating copy to clipboard operation
pyo3 copied to clipboard

pls test for import MetaTrader5-Python CPython module

Open yfcck opened this issue 6 months ago • 0 comments

[dependencies] pyo3 = { version = "0.25.1", features = ["auto-initialize"] }

use pyo3::prelude::*;

fn main() -> PyResult<()> {
    Python::with_gil(|py| {
        let mt5 = py.import("MetaTrader5")?;
        println!("Hello {}", mt5);

        Ok(())
    })
}

Error: PyErr { type: <class 'ImportError'>, value: ImportError('DLL load failed while importing _core: 找不到指定的模块。'), traceback: Some("Traceback (most recent call last):\n File "D:\Python312\Lib\site-packages\MetaTrader5\init.py", line 258, in \n from ._core import *\n") } error: process didn't exit successfully: target\debug\rust-example.exe (exit code: 1)

the MetaTrader5 Python module is compiled using Cpython and is compiled with the code core.cp312-winyamd64.pyd

I encountered the same error when testing with the Go library(github.com/tliron/py4go)

yfcck avatar Jun 16 '25 16:06 yfcck