Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

亲 能否在requirements.txt中把你需求的版本指定一下 #15

Open
kikiyou opened this issue May 25, 2016 · 5 comments
Open

亲 能否在requirements.txt中把你需求的版本指定一下 #15

kikiyou opened this issue May 25, 2016 · 5 comments

Comments

@kikiyou
Copy link

kikiyou commented May 25, 2016

由于没有指定详细的版本,安装的时候 各种报错
django-guardian 现在只支持 django 1.7+
当我把django升级到1.7+的时候 South不能工作
说South只支持1.6
亲 请把详细版本需求说下,感谢

@chenchen1750
Copy link

以下是我之前安装时整理的步骤,希望对你有帮助。

安装 ansible 开源 UI

基础信息

  1. 项目地址
  2. 操作文档
yum install -y mysql-server mysql-devel
yum install -y openldap-devel
yum install -y python-devel
yum install -y git
yum install -y libffi-devel


yum install -y gcc gcc-c++
yum install -y openssl-devel


yum install -y libjpeg-devel
yum install -y zlib-devel

安装 easy_install、pip、virtualenv

yum install -y python-setuptools
easy_install pip
pip install virtualenv

添加用户

useradd ansible
passwd ansible
su - ansible

配置virtualenv环境

virtualenv envansible
source envansible/bin/activate

安装 ansible_ui

下载源码

git clone https://github.com/alaxli/ansible_ui.git

安装依赖库

cd ansible_ui
pip install -r requirements.txt
pip install PIL --allow-external PIL --allow-unverified PIL --allow-external 出错后改用了 pip install Pillow
pip install django-guardian==1.3.0 如果初始化数据库失败,则使用pip install django-guardian==1.2.0
pip install ansible==1.9.6

配置

配置ldap、数据库和邮件信息

cd desktop/core/internal
vim settings_local.py
# 修改 LDAP Datebase Mail 和ansible_playbook命令位置(which ansible_playbook)配置
如果需要使用ldap,还需要修改settings.py,去掉下面行的注释
#'desktop.core.auth.backend.LdapBackend',

配置数据库

create database ansible CHARACTER SET utf8;
grant all on ansible.* to ansibleuser@'localhost' identified by '******';

初始化数据库

python manage.py schemamigration desktop.apps.account --init
python manage.py schemamigration desktop.apps.ansible --init
python manage.py syncdb
python manage.py migrate ansible
python manage.py migrate account
python manage.py migrate kombu.transport.django
python manage.py migrate djcelery
python manage.py migrate guardian

配置celery

修改celery-conf/supervisord.conf
[inet_http_server] #配置web管理supervisor
[program:ansible_celeryd] #修改command中 virtualenv 和 ansible_ui home

配置ansible

cp ansible-conf/ansible.cfg ~/.ansible.cfg

如果要使用密码验证,需要安装 sshpass

cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/home:Strahlex/CentOS_CentOS-6/home:Strahlex.repo
yum install sshpass

启动

启动 celery

supervisord -c celery-conf/supervisord.conf

启动 ansible

python manage.py runserver 0.0.0.0:8000 (此方式用于测试是启动,需要稳定运行可以参照官网的启动方式)

[[分类:运维自动化]]

在 2016-05-25 16:10:07,"kikiyou" [email protected] 写道:

由于没有指定详细的版本,安装的时候 各种报错
django-guardian 现在只支持 django 1.7+
当我把django升级到1.7+的时候 South不能工作
说South只支持1.6
亲 请把详细版本需求说下,感谢


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

@Haitianisgood
Copy link

执行pip install -r requirements.txt

  Running setup.py install for simplejson
    building 'simplejson._speedups' extension
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c simplejson/_speedups.c -o build/temp.linux-x86_64-2.7/simplejson/_speedups.o
    simplejson/_speedups.c:2:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    ***************************************************************************
    WARNING: The C extension could not be compiled, speedups are not enabled.
    Failure information, if any, is above.
    I'm retrying the build without the C extension now.
    ***************************************************************************

    ***************************************************************************
    WARNING: The C extension could not be compiled, speedups are not enabled.
    Plain-Python installation succeeded.
    ***************************************************************************
Compiling /home/ansible/envansible/build/pexpect/pexpect/async.py ...
  File "/home/ansible/envansible/build/pexpect/pexpect/async.py", line 16
    transport, pw = yield from asyncio.get_event_loop()\
                             ^
SyntaxError: invalid syntax

  Running setup.py install for django-guardian
    your setuptools is too old (<12)
    setuptools_scm functionality is degraded



building '_mysql' extension

creating build/temp.linux-x86_64-2.7

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -g -DNDEBUG

_mysql.c:29:20: fatal error: Python.h: No such file or directory

 #include "Python.h"

                    ^

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /home/ansible/envansible/bin/python -c "import setuptools, tokenize;__file__='/home/ansible/envansible/build/MySQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-NPl8Uu-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ansible/envansible/include/site/python2.7 failed with error code 1 in /home/ansibl


@long1112
Copy link

requirement文件中已经有了django-guardian,ansible, 为何你还要自己再安装一遍?
django==1.6
django-celery
django-jsonfield
django-auth-ldap
python-magic
South
simplejson
#pil
pexpect
django-guardian
celery
MySQL-python
python-ldap
ansible
supervisor
threadpool
uwsgi

@vyu923
Copy link

vyu923 commented Jul 6, 2017

大家安装后都能正常使用吗?现在部署密钥的时候不成功,一直报输入的参数是3个,只获得了2个。

1 similar comment
@xuhuigithub
Copy link

大家安装后都能正常使用吗?现在部署密钥的时候不成功,一直报输入的参数是3个,只获得了2个。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants