1 Star 0 Fork 261

jiangtiantu / zvt

forked from foolcage / zvt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
init_env.sh 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
foolcage 提交于 2020-06-23 23:41 . refactor,more abstract,a lot improvement
#!/bin/bash -e
platform='unknown'
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
platform='linux'
elif [[ "$unamestr" == 'Darwin' ]]; then
platform='mac'
fi
install_cmd='sudo apt-get install'
if [[ "$platform" == 'mac' ]]; then
install_cmd='brew install'
fi
BASEDIR=`dirname $0`
if ! which python > /dev/null; then
echo -e "Python3 not found! Install? (y/n) \c"
read
if [ "$REPLY" = "y" ]; then
$install_cmd install python3
fi
fi
pip_opt=''
pip_opt='-i http://pypi.douban.com/simple --trusted-host pypi.douban.com'
if ! which virtualenv > /dev/null; then
echo -e "virtualenv not found! Install? (y/n) \c"
read
if [ "$REPLY" = "y" ]; then
pip3 install virtualenv $pip_opt
fi
fi
if [ ! -d "$BASEDIR/ve" ]; then
virtualenv -p python3 $BASEDIR/ve --no-download
echo "Virtualenv created."
fi
source $BASEDIR/ve/bin/activate
cd $BASEDIR
export PYTHONPATH=$PYTHONPATH:.
if [ ! -f "$BASEDIR/ve/updated" -o $BASEDIR/requirements.txt -nt $BASEDIR/ve/updated ]; then
pip install -r $BASEDIR/requirements.txt $pip_opt
touch $BASEDIR/ve/updated
echo "Requirements installed."
fi
pip install ipython jupyterlab $pip_opt
echo "env ok"
Python
1
https://gitee.com/jiangtiantu/zvt.git
git@gitee.com:jiangtiantu/zvt.git
jiangtiantu
zvt
zvt
master

搜索帮助