我需要强制virtualenv在我的ci服务器上使用已编译的源python(长话短说:travisci支持python2.7.3)。heroku使用2.7.6,我们坚持在与产品相同的环境中进行测试)。但我没能让virtualenv与之抗衡。你知道吗
travis首先运行以下脚本:
if [ ! -d ./compiled ]; then
echo "creating compiled folder"
mkdir compiled
else
echo "compiled exists"
fi
cd compiled
if [ ! -e Python-2.7.6.tar.xz ]; then
echo "Downloading python and compiling"
wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
tar xf Python-2.7.6.tar.xz
cd Python-2.7.6
./configure
make
chmod +x ./python
else
echo "Compiled python exists!"
fi
然后:
- virtualenv -p ./python ./compiled/python276
- source ./compiled/python276/bin/activate
但是当执行python --version
时,显示的是2.7.3而不是2.7.6
我想我错过了什么,谢谢你的帮助!你知道吗
转到virtualenv文件夹,打开bin/文件夹:
删除“python”文件,并创建指向要使用的python可执行文件的符号链接,如:
相关问题 更多 >
编程相关推荐