I am trying to use numpy from Rust using pyO3, all inside a conda environment.
To get pyO3 to link, I installed the GCC toolchain using conda as well.
I can do simple stuff now like displaying sys.path. However, when I try to import numpy, like…
I'm trying to create Actix Actor which has PyO3 Python interpreter & Py objects.
Question is what is the correct way to create python interpreter actor?
I think err caused by Actor trait defined…
I have struct in Rust with following fields and their types:
five i8
six f32
one bool
one Vec of size 4
one Vec> of size 4x20x7
one Vec of size 4x20
one HashMap with 4 keyes
one Vec<(i8, i8)> of size varing from 0 to 30
My…
I Have a Pyo3 project written in rust where I'm generating a python package. To get IDE typings, I've created a .pyi stub, with relevant docstrings.
However, I notice that the docstrings on the actual python objects are empty. This isn't a huge…
I have the following working implementation for reading bytes from a datachannel and returning the bytes as a list in the python interop:
fn read<'a>(&self, py: Python<'a>) -> PyResult<&'a PyAny> {
let mut dc = self.datachannel.clone();
…
I attempted to add #[pyclass] to a struct that includes Rc, but I encountered the following error.
error[E0277]: std::rc::Rc cannot be sent between threads safely
Here's my source code:
struct MyStruct {
name:…
I've been working on integrating rust code into python using PyO3 and Maturin. I've successfully written my Rust class and gotten most of the functionality to work, however I haven't been able to successfully deepcopy the object. I've tried…
I'm new to Rust and I have a problem. I have list in Python. It is a list of objects implemented in PyO3 Rust. I want to pass it to a function to make some changes to the elements.
This is minimal reproducible example:
use…
I'm having issues with attempting to call functions from within other functions in pyo3 with rust.
When I try, and change the output type to a pyresult to get the functions to chain together, I just end up with a whole host of other errors and I was…
I have the beginning of a GUI application written in Rust. I'm using the Py03 crate to run a python function inside my Rust app. I have my python function (test_func) inside a file "test_funcs.py" and this file is located in the same directory as my…
For an existing library, what is the best (or at least good) way to structure the project when creating Python bindings via pyo3 / maturin ?
So far I figure I can either just annotate all the structs and impls with #[pyclass] and #[pymethods]…
I am working on a Django project which includes DRF.
The application is dockerized.
Everything was working fine then suddenly I got the following error in my logs and I am completely clueless how it arrived
patients | [uWSGI] getting INI…
Could someone give a full/working example of a function in pyO3 that takes a single input, and returns true/false depending on whether the input has type scipy.sparse.csr_matrix?
I'm aware that pyO3 has is_instance, but that seems to require having…
I am currently attempting to gain a speed-up for some computationally expensive parts of my Python code by instead rewriting them in Rust with PyO3 and using Maturin to create a Python package. I noticed that the Rust implementation was more than 3…
How does one unpack a python integer as a reference from a rust class method?
I'm trying to expose a rust struct to python but the interpreter complains about the reference to the i32.
This is the code:
#[pyclass]
pub struct DataMap {
entries:…