Python升级(v2.7 -> v3.5)

Python升级(v2.7 -> v3.5)

软件环境

  • Mac: v10.12.6
  • Python: v2.7

从官网下载指定版本

安装

  • 双击 python-3.5.0-macosx10.6.pkg,完成安装即可

修改 .bash_profile 文件

PATH=“/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}”
export PATH

alias python2=‘/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7alias python3=‘/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5

重启终端 || 执行 source ~/.bash_profile 命令

TIPS

  • 在终端中使用 python2 指令,调用的就是 python2.7 的环境
  • 在终端中使用 python3 指令,调用的就是 python3.5 的环境

VSCode ~ Python

设置 Python 版本

设置 Python 版本

设置Python解析器路径

查看 Python 版本

Python 版本

failed UnsatisfiableError: The following specifications were found to be incompatible with the existing python installation in your environment: Specifications: - torchaudio -> python[version='2.7.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|3.4.*'] Your python: python=3.8 If python is on the left-most side of the chain, that's the version you've asked for. When python appears to the right, that indicates that the thing on the left is somehow not available for the python version you are constrained to. Note that conda will not change your python version to a different minor version unless you explicitly specify that. The following specifications were found to be incompatible with each other: Output in format: Requested package -> Available versions Package pytorch-cuda conflicts for: torchvision -> pytorch-cuda[version='11.6.*|11.7.*|11.8.*'] torchaudio -> pytorch==2.0.1 -> pytorch-cuda[version='>=11.6,<11.7|>=11.7,<11.8|>=11.8,<11.9'] torchaudio -> pytorch-cuda[version='11.6.*|11.7.*|11.8.*'] torchvision -> pytorch==2.0.1 -> pytorch-cuda[version='>=11.6,<11.7|>=11.7,<11.8|>=11.8,<11.9'] Package requests conflicts for: python=3.8 -> pip -> requests torchvision -> requests Package setuptools conflicts for: torchvision -> setuptools pytorch -> jinja2 -> setuptools python=3.8 -> pip -> setuptools Package msvc_runtime conflicts for: pytorch -> python[version='>=3.5,<3.6.0a0'] -> msvc_runtime torchvision -> python[version='>=3.5,<3.6.0a0'] -> msvc_runtime Package pytorch conflicts for: torchaudio -> pytorch[version='1.10.0|1.10.1|1.10.2|1.11.0|1.12.0|1.12.1|1.13.0|1.13.1|2.0.0|2.0.1|1.9.1|1.9.0|1.8.1|1.8.0|1.7.1|1.7.0|1.6.0'] torchvision -> pytorch[version='1.10.0|1.10.1|1.10.2|1.11.0|1.12.0|1.12.1|1.13.0|1.13.1|2.0.0|2.0.1|1.9.1|1.9.0|1.8.1|1.8.0|1.7.1|1.7.0|1.6.0|1.5.1']
最新发布
06-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值