You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows系统安装Python版tink库时遇Python路径错误求助

问题:Windows下Python 3.12.10安装tink库失败,提示Python库路径无效

环境与已完成配置

  • 操作系统:Windows
  • Python版本:3.12.10
  • 已完成的依赖准备:
    • 安装protoc并添加至系统PATH
    • 安装bazel并添加至系统PATH
    • 安装Cygwin bash并添加至系统PATH
    • 确认Python路径已加入PATH,且设置了BAZEL_PYTHON和PYTHON_BIN_PATH环境变量

执行命令与错误信息

执行命令:

pip install tink

出现如下错误:

INFO: Repository local_config_python instantiated at:
  C:/temp/pip-install-tolrs06x/tink_587703b11fa04dc4b3364796d840ea99/WORKSPACE:11:18: in <toplevel>
  C:/temp/pip-install-tolrs06x/tink_587703b11fa04dc4b3364796d840ea99/tink_py_deps_init.bzl:24:21: in tink_py_deps_init
Repository rule python_configure defined at:
  C:/users/0014401/_bazel_0014401/dd6c7pmm/external/pybind11_bazel/python_configure.bzl:414:35: in <toplevel>
ERROR: An error occurred during the fetch of repository 'local_config_python':
   Traceback (most recent call last):
    File "C:/users/0014401/_bazel_0014401/dd6c7pmm/external/pybind11_bazel/python_configure.bzl", line 411, column 36, in _python_autoconf_impl
            _create_local_python_repository(repository_ctx)
    File "C:/users/0014401/_bazel_0014401/dd6c7pmm/external/pybind11_bazel/python_configure.bzl", line 360, column 22, in _create_local_python_repository
            _check_python_lib(repository_ctx, python_lib)
    File "C:/users/0014401/_bazel_0014401/dd6c7pmm/external/pybind11_bazel/python_configure.bzl", line 243, column 14, in _check_python_lib
            _fail("Invalid python library path: %s" % python_lib)
    File "C:/users/0014401/_bazel_0014401/dd6c7pmm/external/pybind11_bazel/python_configure.bzl", line 29, column 9, in _fail
            fail("%sPython Configuration Error:%s %s" % (red, no_color, msg))
Error in fail: Python Configuration Error: Invalid python library path: C:\Users\0014401\AppData\Local\Programs\Python\Python312
ERROR: C:/temp/pip-install-tolrs06x/tink_587703b11fa04dc4b3364796d840ea99/WORKSPACE:11:18: fetching python_configure rule //external:local_config_python: Traceback (most recent call last):
    File "C:/users/0014401/_bazel_0014401/dd6c7pmm/external/pybind11_bazel/python_configure.bzl", line 411, column 36, in _python_autoconf_impl
            _create_local_python_repository(repository_ctx)
    File "C:/users/0014401/_bazel_0014401/dd6c7pmm/external/pybind11_bazel/python_configure.bzl", line 360, column 22, in _create_local_python_repository
            _check_python_lib(repository_ctx, python_lib)
    File "C:/users/0014401/_bazel_0014401/dd6c7pmm/external/pybind11_bazel/python_configure.bzl", line 243, column 14, in _check_python_lib
            _fail("Invalid python library path: %s" % python_lib)
    File "C:/users/0014401/_bazel_0014401/dd6c7pmm/external/pybind11_bazel/python_configure.bzl", line 29, column 9, in _fail
            fail("%sPython Configuration Error:%s %s" % (red, no_color, msg))
Error in fail: Python Configuration Error: Invalid python library path: C:\Users\0014401\AppData\Local\Programs\Python\Python312
ERROR: no such package '@@local_config_python//': Python Configuration Error: Invalid python library path: C:\Users\0014401\AppData\Local\Programs\Python\Python312
ERROR: C:/temp/pip-install-tolrs06x/tink_587703b11fa04dc4b3364796d840ea99/tink/cc/pybind/BUILD.bazel:264:17: //tink/cc/pybind:tink_bindings.so depends on @@local_config_python//:python_headers in repository @@local_config_python which failed to fetch. no such package '@@local_config_python//': Python Configuration Error: Invalid python library path: C:\Users\0014401\AppData\Local\Programs\Python\Python312
ERROR: Analysis of target '//tink/cc/pybind:tink_bindings' failed; build aborted: Analysis failed
Analyzing: target //tink/cc/pybind:tink_bindings (91 packages loaded, 907 targets configured)
[1 / 1] checking cached actions
INFO: Elapsed time: 88.382s, Critical Path: 0.13s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
FAILED:
error: command 'C:\\Users\\0014401\\Downloads\\Bazel\\bazel.exe' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for tink
Failed to build tink
ERROR: Could not build wheels for tink, which is required to install pyproject.toml-based projects
WARNING: Failed to remove contents in a temporary directory 'C:\Temp\pip-install-tolrs06x\tink_587703b11fa04dc4b3364796d840ea99'.
You can safely remove it manually.
WARNING: Failed to remove contents in a temporary directory 'C:\Temp\pip-install-tolrs06x'.
You can safely remove it manually.

核心疑问

已确认Python路径配置正确且相关环境变量已设置,但仍收到Invalid python library path错误,如何解决这个问题以成功安装tink库?

内容的提问来源于stack exchange,提问作者Jesus

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 12:14:53