For sake of organization, I've placed all my custom libraries into a subdirectory. When I run my script file in the spyder IDE, it imports everything as intended, and runs smoothly, but when I execute the script from shell, it fails to import. (I have created an __init__.py file in the modules/ directory).
Also, this is being run on Linux.
Here is my code:
import os
dirpath = os.path.dirname(__file__)
sys.path.append('{}/modules/'.format(dirpath))
#custom libraries in dirpath/modules/
import data_pull
import features
import create_listings
example = data_pull.mp(pool)
data = features.generate(example)
Shell output:
Traceback (most recent call last):
File "data_manager.py", line 15, in
import data_pull
ModuleNotFoundError: No module named 'data_pull'