Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running in virtualenvs on Windows #1896

Open
davidhewitt opened this issue Oct 1, 2021 · 0 comments
Open

Running in virtualenvs on Windows #1896

davidhewitt opened this issue Oct 1, 2021 · 0 comments

Comments

@davidhewitt
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant