zl程序教程

您现在的位置是:首页 >  后端

当前栏目

linux系统安装了python中,但是为什么执行有问题

PythonLinux安装系统执行 为什么 但是 问题
2023-09-27 14:21:42 时间

执行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, in <module> import cx_Oracle ImportError: No module named cx_Oracle Traceback (most recent call last): File "py_write_excel.py", line 5, in <module> 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 <module> import cx_Oracle ImportError: No module named cx_Oracle

  

原因是python,命令  是默认用的python2,python2中默认是没有

cx_Oracle这个模块的,,如果改成python3就可以执行了。因为python3中内置
cx_Oracle这个模块