linux系统安装了python中,但是为什么执行有问题
执行python命令 报错如下:nohup python -u py_write_excel.py >>nouhp2.out 2>&1 &
[analyse@host-192-168-1-24 batch]$ more nouhp2.out Traceback (most recent call last): File "py_write_excel.py", line 5, inimport cx_Oracle ImportError: No module named cx_Oracle Traceback (most recent call last): File "py_write_excel.py", line 5, in import cx_Oracle ImportError: No module named cx_Oracle nohup: ignoring input Traceback (most recent call last): File "py_write_excel.py", line 5, in import cx_Oracle ImportError: No module named cx_Oracle
原因是python,命令 是默认用的python2,python2中默认是没有
cx_Oracle这个模块的,,如果改成python3就可以执行了。因为python3中内置
cx_Oracle这个模块