1

Working on code that SSH's into terminal on an external device. This morning the code was able to do so. Then I updated Windows because I had put it off for a while. This was the only thing I did that I could think of may have had an effect.

I now run into a ModuleNotFoundError.

I tried updating pip, uninstalling and reinstalling ssh2-python. I changed python37 folder to read/write. Tried locating the module in python37/Lib/site-packages but not really sure what I'm looking for

SSH's into address' terminal

import socket

from ssh2.session import Session

Expected:
input for ip address

Result:

Traceback (most recent call last):
File "C:/Users/louis/Desktop/ssh2.py", line 4, in <module>

from ssh2.session import Session
File "C:\Users\louis\Desktop\ssh2.py", line 4, in <module>

from ssh2.session import Session

ModuleNotFoundError: No module named 'ssh2.session'; 'ssh2' is not a package
Rahul
  • 576
  • 1
  • 5
  • 9
sinkiez
  • 41
  • 5

1 Answers1

1

I had named a file in the same directory ssh2. Python loaded that instead of the module. Simply renamed the file to anything else and python was able to find the ssh2 module.

sinkiez
  • 41
  • 5