作为个人学习笔记分享,有任何问题欢迎交流!
本人被此问题折磨了整整一个周末,现在问题终于解决了, :)
下面是本人回忆的整个过程,可能会有遗漏,欢迎联系,欢迎交流。
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