繁体   English   中英

在 Cygwin 中安装 python bcrypt 时出现问题

[英]Issue installing python bcrypt in Cygwin

我正在尝试在 Cygwin 中安装 paramiko,其中一个构建依赖项是 bcrypt。 我已经安装了 rustc,并且我相信所有支持的构建库。

Pip 也更新到最新。

$ pip --version
pip 22.2.2 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)

我使用以下 pip 命令:

pip install bcrypt

我收到以下错误 output:

  error: failed to run custom build command for `pyo3-build-config v0.15.2`

  Caused by:
    process didn't exit successfully: `C:\Cygwin64\tmp\pip-install-19d9dusl\bcrypt_117761e212a240d8804ceae0beeb39c1\src\_bcrypt\target\release\build\pyo3-build-config-2ef06b5f5d02e46b\build-script-build` (exit code: 1)
    --- stdout
    cargo:rerun-if-env-changed=PYO3_CONFIG_FILE
    cargo:rerun-if-env-changed=PYO3_NO_PYTHON
    cargo:rerun-if-env-changed=PYO3_PYTHON

    --- stderr
    error: failed to run the Python interpreter at /usr/bin/python.exe: The system cannot find the path specified. (os error 3)
  warning: build failed, waiting for other jobs to finish...
  cargo rustc --lib --message-format=json-render-diagnostics --manifest-path src/_bcrypt/Cargo.toml --release -v --features pyo3/abi3-py36 pyo3/extension-module -- --crate-type cdylib

      =============================DEBUG ASSISTANCE=============================
      If you are seeing a compilation error please try the following steps to
      successfully install bcrypt:
      1) Upgrade to the latest pip and try again. This will fix errors for most
         users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
      2) Ensure you have a recent Rust toolchain installed. bcrypt requires
         rustc >= 1.56.0.

      Python: 3.8.12
      platform: CYGWIN_NT-10.0-19044-3.3.5-341.x86_64-x86_64-64bit-WindowsPE
      pip: n/a
      setuptools: 65.3.0
      setuptools_rust: 1.5.1
      rustc: 1.63.0 (4b91a6ea7 2022-08-08)
      =============================DEBUG ASSISTANCE=============================

  error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path src/_bcrypt/Cargo.toml --release -v --features 'pyo3/abi3-py36 pyo3/extension-module' -- --crate-type cdylib` failed with code 101
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.   ERROR: Failed building wheel for bcrypt Failed to build bcrypt ERROR: Could not build wheels for bcrypt, which is required to install pyproject.toml-based projects

我检查了我的 python 安装(python.exe),它安装在 /usr/bin/python.exe 中。

$ ls /usr/bin/python*
/usr/bin/python.exe        /usr/bin/python2.7.exe   /usr/bin/python3.8-config
/usr/bin/python2-config    /usr/bin/python3         /usr/bin/python3.8.exe
/usr/bin/python2.7-config  /usr/bin/python3-config

所以我很困惑......有什么问题? 为什么找不到我的 python 解释器? 为什么 bcrypt 不构建和安装?

我猜 Cygwin 在这里会引起一些兼容性问题。

看起来 Cygwin 有一个 package 用于此目的,可能会避免这些问题:

https://cygwin.com/packages/summary/python36-bcrypt.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM