So I have the following file structure (win10)
project/
mycode.py
lib/
bunch of python modules
paramiko/
all of paramiko's files
Here, all the modules are in a child folder, and when I say
import paramiko in mycode.py, it can't find paramiko. However, when I move them all out of the lib directory, it works fine.
Working solution:
project/
mycode.py
bunch of python modules
paramiko/
all of paramiko's files
But it's ugly, and I'd rather have all of them in a lib directory. How do I access modules in a child directory?
Edit: Okay, figured it out. I used os. to add to the path:
projectPath = os.path.dirname(os.path.abspath(__file__))
sys.path.append(projectPath+"\\lib")
which I had tried before, except this time, i moved the import paramiko to after the edits made to the path. God I feel stupid sometimes