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 -r requirements.txt Step two, install from the ‘packages’ dir: pip install --no-index --find-links=packages -r requirements.txt
|