I need port some python code in my rust project (calling python from rust).
I am writing an app in rust that in a small part needs to import a module written in python.
This is my project structure.
|...
|extern/python/
|-main.py
|-__init__.py
|src/
|Cargo.toml
|...
I have no problem with executing python code from rust, pyo3's docs cover this.
But I need specify to pyo3
what virtualenv
use to link to my rust crate, almost all of the pyo3's docs is focused on how to use rust from python and there is very little information about how to use python from rust.
In my python code y use pyenv
to isolate the virtualenv, e.g. to run the python code
cd /python/code
pyenv shell my_py_env
python3 main.py
So the thing is, how can I tell to pyo3 to use "my_py_env"
when linking the python module?