安装openstack开发环境

作为个人学习笔记分享,有任何问题欢迎交流!


本人被此问题折磨了整整一个周末,现在问题终于解决了, :)

下面是本人回忆的整个过程,可能会有遗漏,欢迎联系,欢迎交流。


1. 在non-root下

git clone git://github.com/openstack/cinder.git

cd cinder


2. 这时如果马上./run_test.sh, 要你创建虚拟环境,要求安装virtualenv, 

apt-get install  python-pip

pip install virtualenv

   再次./run_test.sh,会下载各种测试环境中用到包,默认从国外下载,这个一般会下载到半路就会断掉,如果你想再次./run_test.sh的话,会失败,这时要rm -rf .venv/后, 再运行。


3. 不能从国外下载的话,有两个办法可以解决:

    #制作本地源,这个可以参考:http://blog.csdn.net/xiaoquqi/article/details/9563997(本人没有试过,看了一下,其中的pip-requires在cinder里变为requirements

    #使用国内的pip镜像,参考:http://blog.csdn.net/Sasoritattoo/article/details/10020547

国内的源:

1.http://pypi.v2ex.com/simple

2.http://e.pypi.python.org/simple

3.http://mirrors.tuna.tsinghua.edu.cn/pypi/simple


4. 在.pip/下创建文件pip.conf

   加入

[global]

  index-url=http://mirrors.tuna.tsinghua.edu.cn/pypi/simple

    ./run_test.sh(可能会报Error: pg_config executable not found.可sudo apt-get install libpq-dev python-dev解决)


下面的方法是先下载,然后在安装:

mkdir packages
pip install --download=packages --no-install -r requirements.txt

Step two, install from the ‘packages’ dir:

pip install --no-index --find-links=packages -r requirements.txt

ps: centos6.4安装会被错:command 'gcc' failed with exit status 1

可以通过安装:yum install libxslt-devel libxml2-devel

yum install gcc python-devel解决

ubuntu:

sudo apt-get install build-essential libssl-dev libffi-dev python-dev

如果报:Bad md5 hash for package 

可以source .venv/bin/activate
tools/with_venv.sh pip install --upgrade --no-cache-dir -r neutron/requirements.txt


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值