dgrunwald / rust-cpython

Rust <-> Python bindings
MIT License
1.81k stars 136 forks source link

LNK1181 error on W10 trying to use this module #262

Open Mrodent opened 3 years ago

Mrodent commented 3 years ago

I am trying to write a Rust module which can be called from CPython.

Please see this SO question.

The build never works with --release switch and only intermittently without it.

I have no idea what the issue is here but it's presumably something to do with the toolchain(s) on W10.

dgrunwald commented 2 years ago

rust-cpython will (via this build script) ask your current Python interpreter for its sys.exec_prefix. It'll then look for python39.lib relative to that directory. Which Python interpreter gets asked can be controlled with the PYTHON_SYS_EXECUTABLE envvar, if that isn't set, it'll use python or python3 in PATH.

Try running python -c "import sys; print(sys.exec_prefix)" and see if that directory contains libs/python39.lib.