欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

自己亲自做的 安装 anaconda3 anaconda 3 包含对 inter 芯片和 m1 芯片的处理 有大用 有大大用 有大大大用 有大大大大用

#!/bin/bash
#
/bin/mkdir -p "${HOME}/Desktop/downloadfromjamf"
cd  "${HOME}/Desktop/downloadfromjamf"
sysctl  -n machdep.cpu.brand_string | grep -i Intel
   
if [ $? = 0 ];then    
   #inter  
   /usr/bin/curl -o "./Anaconda3-2022.10-MacOSX-x86_64.sh.zip"  "http://aaaa.com/util/software/Anaconda3-2022.10-MacOSX-x86_64.sh.zip"
   unzip -o "./Anaconda3-2022.10-MacOSX-x86_64.sh.zip"
   chmod -R 777 "${HOME}/Desktop/downloadfromjamf"
   bash ./Anaconda3-2022.10-MacOSX-x86_64.sh -b -p ${HOME}/anaconda3/
   echo 'export PATH="${HOME}/anaconda3/bin:$PATH"' >> ${HOME}/.bash_profile  
   source ${HOME}/.bash_profile
   echo 'export PATH="${HOME}/anaconda3/bin:$PATH"' >> ${HOME}/.zshrc
   source ${HOME}/.zshrc
   
   source ${HOME}/anaconda3/bin/activate
   conda init
else    
  #M1 or M2  
   /usr/bin/curl -o "./Anaconda3-2022.10-MacOSX-arm64.sh.zip"  "http://aaaa.com/util/software/Anaconda3-2022.10-MacOSX-arm64.sh.zip"
   unzip -o "./Anaconda3-2022.10-MacOSX-arm64.sh.zip"
   chmod -R 777 "${HOME}/Desktop/downloadfromjamf"
   bash ./Anaconda3-2022.10-MacOSX-arm64.sh -b -p /${HOME}/anaconda3/
   echo 'export PATH="${HOME}/anaconda3/bin:$PATH"' >> ${HOME}/.bash_profile  
   source ${HOME}/.bash_profile
   echo 'export PATH="${HOME}/anaconda3/bin:$PATH"' >> ${HOME}/.zshrc
   source ${HOME}/.zshrc
   
   source ${HOME}/anaconda3/bin/activate
   conda init zsh
fi

#myenv.zip是python3.12.2, 把 python3.12的内容  复制到 Users/bbbb-admin/anaconda3/envs/
/usr/bin/curl -o "./myenv3.12.zip"  "http://aaaa.com/util/software/myenv3.12.zip"
unzip -o "./myenv3.12.zip"

sudo /bin/cp -a ./myenv3.12 "${HOME}/anaconda3/envs/"


#myenv3.11.zip是python3.11, 把 python3.11的内容  复制到 Users/bbbb-admin/anaconda3/envs/
/usr/bin/curl -o "./myenv3.11.zip"  "http://aaaa.com/util/software/myenv3.11.zip"
unzip -o "./myenv3.11.zip"
sudo /bin/cp -a ./myenv3.11 "${HOME}/anaconda3/envs/"

#myenv3.10.zip是python3.10, 把 python3.10的内容  复制到 Users/bbbb-admin/anaconda3/envs/
/usr/bin/curl -o "./myenv3.10.zip"  "http://aaaa.com/util/software/myenv3.10.zip"
unzip -o "./myenv3.10.zip"
sudo /bin/cp -a ./myenv3.10 "${HOME}/anaconda3/envs/"




(/usr/bin/osascript -e  'display dialog "成功安装Anaconda3,您可以删除桌面上的downloadfromjamf目录,如果打开Anaconda3出现错误,请重启电脑!" buttons {"OK"}   default button "OK"')
#把文件夹权限置为 777  ,让所有人可以删
sudo chmod -R 777 "${HOME}/Desktop/downloadfromjamf/"
#rm -Rf "${HOME}/Desktop/downloadfromjamf"
exit 0


普通分类: