Very new to Rust.
I'm trying to build a python module in Rust using rust-cypthon. Currently, I can access cpython types but can't call py_module_initializer! which I believe is required to make the module run in python.
When compiling the code, changing the extension to .so and putting the file in with my python scripts and importing, I get this error:
ImportError: dynamic module does not define init function (initpyext_rust_onboard)
Cargo.toml
[lib]
crate-type = ["cdylib"]
[dependencies]
csv = "1.1.1"
serde = "1.0.99"
serde_derive="1.0"
serde_json= "1.0"
serde_yaml = "0.7.1"
[dependencies.cpython]
version = '0.3.0'
default-features = false
features = ["python27-sys", "extension-module-2-7"]
Dependencies imported to lib.rs
#[macro_use]
extern crate serde;
extern crate serde_derive;
#[macro_use]extern crate cpython;
use std::fs::File;
use std::collections::HashMap;
use std::borrow::Cow;
use std::error::Error;
use cpython::{Python, PyObject, PyResult, PyString, PyFloat};
use csv::DeserializeRecordsIter;