Running in virtualenvs on Windows
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.2k
- Forks
- 1k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 66
Description
See also #1835
If I create a new virtualenv on Windows, install tomli into it, and run the following program:
use pyo3::prelude::*;
fn main() -> PyResult<()>{
Python::with_gil(|py| {
let m = PyModule::import(py, "tomli")?;
Ok(())
})
}
Then this fails to import tomli, despite building correctly with the virtualenv. On linux (at least Ubuntu 20.04) the equivalent works correctly.
I suspect we could investigate how pyo3::prepare_freethreaded_python sets up the interpreter - presumably on Windows it fails to detect the virtualenv, but on Linux it's fine.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Windows virtualenv case from the issue, comparing it with the stated Ubuntu behavior. Read the interpreter setup around pyo3::prepare_freethreaded_python and investigate how the virtualenv is detected. Done means a Rust program can import tomli from a Windows virtualenv as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- backend, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100