I have written Python code which is divided among couple of files i.e.
record_1.py
record_2.py
record_3.py
record_4.py
main.py
All these files are placed in a common folder:
/user/mario/python/sampletest
When I am trying to import the above files in main.py it's giving error While executing the below command:
$] python main.py
ImportError: No module named record_1
Below is the main.py code:
import jaydebeapi
import record_1,record_2,record_3,record_4
def main():
def teradata_conn():
try:
conn_teradata = jaydebeapi.connect(jclassname='com.teradata.jdbc.TeraDriver',
url="jdbc:teradata://10.10.10.10",
driver_args=['@user','@pass'],
jars=['/user/mario/python/jar/tdgssconfig.jar','/user/mario/python/jar/terajdbc4.jar'])
print("Connection was successful")
record_1()
record_2()
record_3()
record_4()
except Exception as e:
print(e)
if __name__ == '__main__':
main()
Any help or suggestion is highly appreciated.
import sys
print (repr(sys.path))
['', '/user/mario/anaconda2/lib/python27.zip',
'/user/mario/anaconda2/lib/python2.7',
'/user/mario/anaconda2/lib/python2.7/plat-darwin',
'/user/mario/anaconda2/lib/python2.7/plat-mac',
'/user/mario/anaconda2/lib/python2.7/plat-mac/lib-scriptpackages',
'/user/mario/anaconda2/lib/python2.7/lib-tk',
'/user/mario/anaconda2/lib/python2.7/lib-old',
'/user/mario/anaconda2/lib/python2.7/lib-dynload',
'/user/mario/anaconda2/lib/python2.7/site-packages',
'/user/mario/anaconda2/lib/python2.7/site-packages/aeosa',
'/user/mario/anaconda2/lib/python2.7/site
packages/IPython/extensions',
'/user/mario/.ipython']