1 Star 0 Fork 230

fushuxiong/fooltrader

forked from foolcage/fooltrader 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
init_env.sh 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
xuanqi 提交于 2018-04-15 09:10 . tmp change
#!/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='sudo brew install'
fi
BASEDIR=`dirname $0`
if ! which python3 > /dev/null; then
echo -e "Python3 not found! Install? (y/n) \c"
read
if [ "$REPLY" = "y" ]; then
$install_cmd install python3
fi
fi
if ! which virtualenv > /dev/null; then
echo -e "virtualenv not found! Install? (y/n) \c"
read
if [ "$REPLY" = "y" ]; then
$install_cmd python-virtualenv
fi
fi
if [ ! -d "$BASEDIR/ve" ]; then
virtualenv -p python3 $BASEDIR/ve
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 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
touch $BASEDIR/ve/updated
pip install ipython -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
echo "Requirements installed."
fi
echo "env ok"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/fushuxiong/fooltrader.git
git@gitee.com:fushuxiong/fooltrader.git
fushuxiong
fooltrader
fooltrader
master

搜索帮助