python 执行脚本,root用户正常,切换其他用户报错:
Traceback (most recent call last):
File "/app/pyjobs/onlineMiningServers/onlineFrameServer/modelService.py", line 11, in <module>
import msRegion,msMaster_tcp2http,msMasterHttp,msMaster,msRegionHttp
File "/app/pyjobs/onlineMiningServers/onlineFrameServer/msRegion.py", line 13, in <module>
from keras import backend as K
ImportError: cannot import name 'backend'
排查后发现Python模块目录权限有问题,其他用户无法读取到安装的模块,修改权限命令如下:
chmod -R 755 /usr/local/Python-3.6.1/lib/python3.6/site-packages/*
修改权限后其他用户执行python 脚本正常