2 Star 6 Fork 5

吉客固件(dugiware)/dugitools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
006.install_python3.sh 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
东旗极限 提交于 2024-07-22 05:26 . 1.删除004.install_gcc.sh
#!/bin/bash
set -e
#使用颜色打印函数
source ~/.colorc
do_install()
{
swarn "Install $1 [CHECK]"
depends_str=$(apt-cache depends $1 | grep Depends | awk '{print $2}')
if [ -n "${depends_str}" ]; then
snote "Depends:"
sinfo "${depends_str}"
else
snote "Depends: nothing"
fi
swarn "Install $1 [START]"
#sudo apt-get install -y $1 > /dev/null 2>&1
sudo apt-get install -y $1
if [ $? -eq 0 ]; then
sdone "Install $1 [OK]"
else
serro "Install $1 [ERROR]"
exit 1
fi
}
do_python3_install()
{
swarn "Instal python3 [START]"
set +e
if [ ! -e /usr/local/bin/python3 ]; then
do_install python3
sudo update-alternatives --remove-all python
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 50
else
sudo update-alternatives --remove-all python
sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3 50
fi
python --version
sdone "Instal python3 [DONE]"
}
do_pip3_install()
{
swarn "Instal python3-pip [START]"
do_install python3-pip
sdone "Instal python3-pip [DONE]"
}
pip3_modules_install()
{
swarn "Instal python3 modules [START]"
sudo pip3 install pyserial
sudo pip3 install future
sudo pip3 install cryptography
sdone "Instal python3 modules [DONE]"
}
do_python3_install
#do_pip3_install
#pip3_modules_install
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/dugiware/dugitools.git
git@gitee.com:dugiware/dugitools.git
dugiware
dugitools
dugitools
master

搜索帮助