centos8运行脚本找不到python项目解决
shell终端进行两步操作即可:
(1)export PYTHONPATH=项目路径(ps:如/data/project/test)
(2)env | grep PYTHONPATH若有 PYTHONPATH=/data/project/test则说明成功。
在shell脚本中加入python工程路径到PYTHONPATH变量中:如下
#!/bin/sh #chkconfig: 35 20 80 #description: start mount mydisk export PYTHONPATH=/mnt/udisk/project/myproject/wanwenyc /mnt/udisk/project/myenv/myfirstenv/bin/python /mnt/udisk/project/myproject/wanwenyc/WWSpider/mybase/spiderHanMan.py &
如上,在运行的shel脚本中将工程目录/mnt/udisk/project/myproject/wanwenyc加入到PYTHONPATH变量中
相关推荐
YENCSDN 2020-11-17
lsjweiyi 2020-11-17
houmenghu 2020-11-17
Erick 2020-11-17
HeyShHeyou 2020-11-17
以梦为马不负韶华 2020-10-20
lhtzbj 2020-11-17
夜斗不是神 2020-11-17
pythonjw 2020-11-17
dingwun 2020-11-16
lhxxhl 2020-11-16
坚持是一种品质 2020-11-16
染血白衣 2020-11-16
huavhuahua 2020-11-20
meylovezn 2020-11-20
逍遥友 2020-11-20
weiiron 2020-11-16