Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from source build documentation #165

Open
smurguia opened this issue Dec 10, 2021 · 6 comments
Open

Update from source build documentation #165

smurguia opened this issue Dec 10, 2021 · 6 comments

Comments

@smurguia
Copy link

smurguia commented Dec 10, 2021

Bug reports

ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/vy/wtkzjlqx7kv442vcjx4mh9400000gn/T/pip-install-jlfhuw96/ssh2-python_a5fdf50f6e8f430f9993603a5bb86f32/setup.py'"'"'; file='"'"'/private/var/folders/vy/wtkzjlqx7kv442vcjx4mh9400000gn/T/pip-install-jlfhuw96/ssh2-python_a5fdf50f6e8f430f9993603a5bb86f32/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/vy/wtkzjlqx7kv442vcjx4mh9400000gn/T/pip-record-odjgx9ar/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/ssh2-python Check the logs for full command output.

Steps to reproduce:

  1. Use Apple Silicon Mac
  2. Brew install cmake and libssh2
  3. Update Python to 3.9+
  4. python3 -m pip install ssh2_python

Expected behaviour:
Able to install and use ssh2_python

Actual behaviour:
Find_package fails to find libssh and cmake install command errors out

Additional info:
libssh2: stable 1.10.0 (bottled)

ssh2_python_install_error.txt

@pkittenis
Copy link
Member

pkittenis commented Dec 14, 2021

Thanks for the interest and report.

From log output:

    CMake Error at /opt/homebrew/Cellar/cmake/3.22.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (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)

OpenSSL is required for from source installations. See documentation.

@smurguia
Copy link
Author

Openssl is installed

sarah@MacBook-Pro-2 ~ % brew list
==> Formulae
ca-certificates	cmake		libssh2		[email protected]

This package is able to install on Intel based Macs but not Apple Silicon

@smurguia
Copy link
Author

@pkittenis Can we reopen this?

@pkittenis
Copy link
Member

pkittenis commented Dec 16, 2021

Can try:

SYSTEM_LIBSSH2=1 python3 -m pip install ssh2-python

To use system library instead of building embedded libssh2. Otherwise will have to set OPENSSL_ROOT_DIR env variable to the openssl installation dir. This is build system dependent, nothing the library can do about it.

Source build docs could use an update with instructions.

@pkittenis pkittenis reopened this Dec 16, 2021
@pkittenis pkittenis changed the title Unable to install ssh2_python Apple Silicon Update from source build documentation Dec 16, 2021
@smurguia
Copy link
Author

smurguia commented Jan 5, 2022

Setting SYSTEM_LIBSSH2=1 did not work but setting OPENSSL_ROOT_DIR did.

The documentation states that Wheel packages have no dependencies but I have to brew install these packages and manually list the OPENSSL_ROOT_DIR to install, do you know why?

@pkittenis
Copy link
Member

There are no wheels provided for Apple Silicon Mac. The above is a from source build.

@pkittenis pkittenis removed the invalid label Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants