Skip to content

ModuleNotFoundError: import ssh2.session #219

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

Open
acarlstein opened this issue Apr 19, 2025 · 2 comments
Open

ModuleNotFoundError: import ssh2.session #219

acarlstein opened this issue Apr 19, 2025 · 2 comments

Comments

@acarlstein
Copy link

I tried everything to make this work:

brew install cmake
brew install libssh2
pip install --upgrade pip setuptools wheel
pip install ssh2-python
brew info libssh2

Everything seems to work but when I try to run my python code it fails on the import!!!

Image
@pkittenis
Copy link
Member

pkittenis commented Apr 24, 2025

Thanks for the interest.

pip show ssh2-python will confirm it is installed. python -c 'import ssh2.session' to confirm it is installed correctly.

Use command line and show steps to reproduce with error message(s) if you think there is an issue with the library.

@acarlstein
Copy link
Author

acarlstein commented Apr 27, 2025

@pkittenis Thank you for answering the issue I created.

I run both commands. The second command fails.

% pip show ssh2-python                                                                     main
Name: ssh2-python
Version: 1.1.2.post1
Summary: Bindings for libssh2 C library
Home-page: https://github.com/ParallelSSH/ssh2-python
Author: Panos Kittenis
Author-email: [email protected]
License: LGPLv2
Location: /usr/local/lib/python3.11/site-packages
Requires: 
Required-by: 
 % python3 -c 'import ssh2.session'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import ssh2.session
ModuleNotFoundError: No module named 'ssh2'

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