1
我需要強制virtualenv在我的ci服務器上使用編譯後的源python(長話短說:travis ci支持python 2.7.3。heroku適用於2.7.6和我們堅持在與生產相同的環境中進行測試)。但是我沒能讓virtualenv反對它。第一設置virtualenv使用從源python編譯爲bin
特拉維斯運行此腳本:
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
猜我失蹤東西,感謝您的幫助!
編譯後的Python二進制文件的完整路徑(或相對於home)是什麼? – btse