Skip to content
Advertisement

Issue installing python bcrypt in Cygwin

I’m trying to install paramiko in Cygwin and one of the build dependencies is bcrypt. I have rustc installed and I believe all of the supporting build libraries.

Pip is also updated to the latest.

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

I use the following pip command:

pip install bcrypt

And I get the following error output:

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

  Caused by:
    process didn't exit successfully: `C:Cygwin64tmppip-install-19d9duslbcrypt_117761e212a240d8804ceae0beeb39c1src_bcrypttargetreleasebuildpyo3-build-config-2ef06b5f5d02e46bbuild-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

I check my python installation (python.exe) and it is installed at /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

So I am confused…..what is the issue? Why can’t it find my python interpreter? Why is bcrypt not building and installing?

Advertisement

Answer

I’m guessing that Cygwin causes some compatibility issues here.

It looks like Cygwin has a package for this purpose, likely to avoid these issues:

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

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement