failed to run custom build command for `python3-sys v0.5.0` Permission denied (os error 5)
Environment: System: Windows 10 Python: python3.7.5 rust-cpython: 0.5.0 rustc: 1.44.0-nightly (f509b26a7 2020-03-18)
setps: 1、I new rust project by command : cargo new pytest 2、add cpython = 0.5 in cargo.toml 3、build project by command : cargo build
Will get Error:
Compiling cpython v0.5.0
Compiling python3-sys v0.5.0
Compiling paste v0.1.16
error: failed to run custom build command for `python3-sys v0.5.0`
Caused by:
process didn't exit successfully: `G:\GitTestRoot\rustTest\pytestx\target\debug\build\python3-sys-343689970edf861d\build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "failed to run python interpreter `\"D:\\\\Python375\" \"-c\" \"import sys; import sysconfig; print(sys.executable); print(sys.version_info[0:2]); print(sysconfig.get_config_var(\\\'LIBDIR\\\')); print(sysconfig.get_config_var(\\\'Py_ENABLE_SHARED\\\')); print(sysconfig.get_config_var(\\\'LDVERSION\\\') or \\\'%s%s\\\' % (sysconfig.get_config_var(\\\'py_version_short\\\'), sysconfig.get_config_var(\\\'DEBUG_EXT\\\') or \\\'\\\')); print(sys.exec_prefix);\"`: 拒绝访问(means Permission denied)。 (os error 5)"', C:\Users\xly\.cargo\registry\src\github.com-1ecc6299db9ec823\python3-sys-0.5.0\build.rs:450:35
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I try to reinstall python add modify D:\Python375 permission ,but still error.
Compiling cpython v0.5.0
Compiling python3-sys v0.5.0
Compiling paste v0.1.16
error: failed to run custom build command for python3-sys v0.5.0
Caused by:
process didn't exit successfully: G:\GitTestRoot\rustTest\pytestx\target\debug\build\python3-sys-343689970edf861d\build-script-build (exit code: 101)
--- stderr
thread 'main' panicked at 'called Result::unwrap() on an Err value: "failed to run python interpreter \"D:\\\\Python375\" \"-c\" \"import sys; import sysconfig; print(sys.executable); print(sys.version_info[0:2]); print(sysconfig.get_config_var(\\\'LIBDIR\\\')); print(sysconfig.get_config_var(\\\'Py_ENABLE_SHARED\\\')); print(sysconfig.get_config_var(\\\'LDVERSION\\\') or \\\'%s%s\\\' % (sysconfig.get_config_var(\\\'py_version_short\\\'), sysconfig.get_config_var(\\\'DEBUG_EXT\\\') or \\\'\\\')); print(sys.exec_prefix);\": 拒绝访问(means Permission denied)。 (os error 5)"', C:\Users\xly.cargo\registry\src\github.com-1ecc6299db9ec823\python3-sys-0.5.0\build.rs:450:35
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
The \"D:\\\\Python375\" part is suspicious, as it looks like the script has resolved the python interpreter's location to D:\Python375, which is highly unlikely - since this is Windows it should be pointing at python.exe. You should check to see what your environment is set up as, and make sure the build script can find python.