1 将python3.7的所有安装包安装到python3.9
# 导出python3.7所有安装包
~ % pip3.7 freeze > requirements.txt # requirements.txt 自定义
# 安装所有安装包到python3.9
~ % pip3.9 install -r requirements.txt
2 SSL安全认证报错
报错: ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)
解决:
- cd /Applications
- cd Python\ 3.9/
- sudo ./Install\ Certificates.Command
3 一台机器上安装了多个版本的python,操作记录:
# 进入python3.9的代码行
~ % python3.9