install_dir=/usr/local/anaconda3
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # script dir
bash $DIR/Anaconda3-5.0.1-Linux-x86_64.sh -b -p $install_dir
$install_dir/bin/conda install --use-local $DIR/mock-2.0.0-py36_0.tar.bz2
$install_dir/bin/conda install --use-local $DIR/pbr-3.1.1-py36_0.tar.bz2
$install_dir/bin/conda install --use-local $DIR/protobuf-3.5.1-py36_3.tar.bz2
$install_dir/bin/conda install --use-local $DIR/tensorflow-1.4.0-py36_0.tar.bz2
$install_dir/bin/conda install --use-local $DIR/tflearn-0.3.2-py36_0.tar.bz2
export LD_LIBRARY_PATH=$install_dir/lib/:$LD_LIBRARY_PATH
export PATH=$install_dir/bin:$PATH
# test if all python lib install correctly
$install_dir/bin/python -c "import tensorflow"
if [[ $? == "0" ]]; then
echo "tensorflow install successfully!"
else
echo "tensorflow install failed!"
exit 1
fi
$install_dir/bin/python -c "import tflearn"
if [[ $? == "0" ]]; then
echo "tflearn install successfully!"
else
echo "tflearn install failed!"
exit 1
fi# add to source env file
env_file=$DIR//detect_env.sh
echo "#!/usr/bin/bash" > $env_file
echo "export LD_LIBRARY_PATH=$install_dir/lib/:\$LD_LIBRARY_PATH" >> $env_file
echo "export PATH=$install_dir/bin:\$PATH" >> $env_file
echo "!!!Important!!!"
echo "Please use source $env_file to use tensorflow and tflearn...."
标签:bin,anaconda,echo,DIR,install,tflearn,PATH,安装,dir From: https://blog.51cto.com/u_11908275/6392949