ssh-python的建筑轮子失败

问题描述

当我尝试安装并行ssh时,由于某种原因,我会以红色显示此错误。我认为问题在于打开的ssl和ssh2-python的构建轮

"c:\\python\\python.exe"

然后在这里尝试使用我不知道的其他文件

Building wheels for collected packages: ssh2-python,ssh-python
  Building wheel for ssh2-python (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\mr ihab badr\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'C:\\Users\\MR Ihab Badr\\AppData\\Local\\Temp\\pip-install-88x5vkqr\\ssh2-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\MR Ihab Badr\\AppData\\Local\\Temp\\pip-install-88x5vkqr\\ssh2-python\\setup.py'"'"';f=getattr(tokenize,'"'"'open'"'"',open)(__file__);code=f.read().replace('"'"'\r\n'"'"','"'"'\n'"'"');f.close();exec(compile(code,__file__,'"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\MR Ihab Badr\AppData\Local\Temp\pip-wheel-v1bw54kg'
       cwd: C:\Users\MR Ihab Badr\AppData\Local\Temp\pip-install-88x5vkqr\ssh2-python\
  Complete output (29 lines):
  -- Building for: Visual Studio 15 2017
  -- Selecting Windows SDK version 10.0.16299.0 to target Windows 10.0.17134.
  -- The C compiler identification is MSVC 19.16.27034.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  CMake Error at C:/Users/MR Ihab Badr/AppData/Local/Programs/Python/Python38-32/Lib/site-packages/cmake/data/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
    Could NOT find OpenSSL,try to set the path to OpenSSL root folder in the
    system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY
    OPENSSL_INCLUDE_DIR)
  Call Stack (most recent call first):
    C:/Users/MR Ihab Badr/AppData/Local/Programs/Python/Python38-32/Lib/site-packages/cmake/data/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
    C:/Users/MR Ihab Badr/AppData/Local/Programs/Python/Python38-32/Lib/site-packages/cmake/data/share/cmake-3.18/Modules/FindOpenSSL.cmake:486 (find_package_handle_standard_args)
    src/CMakeLists.txt:63 (find_package)


  -- Configuring incomplete,errors occurred!
  See also "C:/Users/MR Ihab Badr/AppData/Local/Temp/pip-install-88x5vkqr/ssh2-python/src/CMakeFiles/CMakeOutput.log".
  Traceback (most recent call last):
    File "<string>",line 1,in <module>
    File "C:\Users\MR Ihab Badr\AppData\Local\Temp\pip-install-88x5vkqr\ssh2-python\setup.py",line 36,in <module>
      build_ssh2()
    File "C:\Users\MR Ihab Badr\AppData\Local\Temp\pip-install-88x5vkqr\ssh2-python\_setup_libssh2.py",line 21,in build_ssh2
      check_call('cmake ../libssh2 -DBUILD_SHARED_LIBS=ON \
    File "c:\users\mr ihab badr\appdata\local\programs\python\python38-32\lib\subprocess.py",line 364,in check_call
      raise CalledProcessError(retcode,cmd)
  subprocess.CalledProcessError: Command 'cmake ../libssh2 -DBUILD_SHARED_LIBS=ON     -DENABLE_ZLIB_COMPRESSION=ON -DENABLE_CRYPT_NONE=ON     -DENABLE_MAC_NONE=ON -DCRYPTO_BACKEND=OpenSSL' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for ssh2-python

有人可以帮忙吗?我对python的经验不是很丰富,我也尝试安装ssh2-python,但遇到类似的错误

解决方法

Wheels - Python 二进制包 - 为这些包的大多数平台提供,包括适用于 Python 3.5-3.9(64 位)的 Windows。

以上是尝试在 Windows 上的 32 位 Python 上安装,未提供二进制包。

因此它尝试从源代码构建,但由于缺乏依赖关系而失败:

missing: OPENSSL_CRYPTO_LIBRARY

可以:

  • 尝试让它们在 32 位 Windows 上构建(不推荐)
  • 使用 Python 64 位

后者将启用二进制包的使用并且不需要编译。前者是PITA。

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...