jumpserver无法启动

来源:5-2 JumpServer安装配置

jeychu

2019-01-14

系统信息及报错如下:
//系统信息
[root@jumpserver jumpserver]# uname -r
3.10.0-693.el7.x86_64

//django已安装,并且可以导入
[root@jumpserver jumpserver]# python3
Python 3.6.5 (default, Jan 13 2019, 12:28:15)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import django

//报错显示django无法导入
./jms start
Sun Jan 13 21:24:40 2019
Jumpserver version 1.4.6, more see https://www.jumpserver.org
Check database connection …
Traceback (most recent call last):
File “manage.py”, line 23, in
"Couldn’t import Django. Are you sure it’s installed and "
ImportError: Couldn’t import Django. Are you sure it’s installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
Check database connection …

请老师解答一下,十分感谢!

写回答

2回答

styluo

2019-01-28

提供一下我的猜测,我在自己机器上这样可行,不知道是不是一个问题

manager.py调用的还是python而不会使用python3,导致模块无法找到,参考https://github.com/jumpserver/jumpserver/blob/master/apps/manage.py

最好还是使用virtualenv,可以将/usr/bin/python 替换为对应的 /usr/local/python/bin/python3

mv /usr/bin/python /usr/bin/python2

rm -rf /usr/bin/python

ln -s /usr/local/python/bin/python3 /usr/bin/python

修改后可能导致yum无法使用,需要修改

vi /usr/bin/yum

#!/usr/bin/python2

0
0

七寸法师

2019-01-15

Django 感觉这个有问题

0
0

中小型企业通用自动化运维架构

Jenkins+Ansible+Zabbix+Jumpserver+ELK,一套“拿来就能用”的自动化运维架构

544 学习 · 106 问题

查看课程