问题描述:

在pip安装pytorch时遇见的问题

$ pip install torch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0
DEPRECATION: Python 2.7 reached the end of its life 
on January 1st, 2020. Please upgrade your Python as 
Python 2.7 is no longer maintained. pip 21.0 will 
drop support for Python 2.7 in January 2021. More 
details about Python 2 support in pip can be found 
at https://pip.pypa.io/en/latest/development
/release-process/#python-2-support pip 21.0 will 
remove support for this functionality.

原因分析:

默认的python环境为2.7,而pip在安装的时候会提示Python 2.7 reached the end of its life on January 1st, 2020.,因此我们需要更改运行环境。
换言之,此时我们用pip安装的就是在python3下安装的。

解决方案:

1.查看默认的python地址,返回 /usr/bin/python

$ which python

2.查看对应版本,返回Python 2.7.17

$ /usr/bin/python -V

3.类似操作,得到Python3的地址以及对应版本号

$ which python3
$ /usr/bin/python3

4.接下来我们写一个配置文件:

$ gedit ~/.bash_profile

往里面写入:

PATH="/usr/bin:${PATH}"
export PATH
alias python="/usr/bin/python3"

然后保存退出

$ source ~/.bash_profile

5.然后输入python运行的就是python3的环境了。
在这里插入图片描述
6.紧接着安装我们的pytorch1.7.0
首先,更新pip包

$ python -m pip install --upgrade pip

其次,开始安装,然而还是这个问题

$ pip install torch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0

在这里插入图片描述
按照错误提示,加上python3 -m命令,安装成功

$ python3 -m pip install torch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0
                    DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Pytho
                    问题描述:在pip安装pytorch时遇见的问题$ pip install torch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop sup
					
pythonPython 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Py
可以从PyPI或Anaconda安装deprecation-alias 。 要使用pip安装: $ python -m pip install deprecation-alias 要安装conda : 首先添加所需的频道 $ conda config --add channels http://conda.anaconda.org/conda-forge $ conda config --add channels http://conda.anaconda.org/domdfcoding $ conda install deprecation-alias
OllyDBG v1.10 plugin - StrongOD v0.3.0 by 海风月影[CUG] ==================================================================== [2010.01.29 v0.3.0.600] 1,增加驱动兼容性 2,自动patch原版od的classname(有些杀软可能报毒) 3,修复一个SECTION识别错误的BUG 4,Upk2010特别版,添加Splash(照片为Upk形象大使)
将mac默认的Python2.7改为Python3 鉴于mac默认的python环境为2.7,而pip在安装的时候会提示Python 2.7 reached the end of its life on January 1st, 2020.,因此我们需要更改运行环境。 which python 返回python2.7的地址,我们可以用这个地址+’-V’的形式得到具体版本,如我python2.7地址为/usr/bin/python,我输入 /usr/bin/python`-V Pytho
python3.7.4官方文档。Python 3.7.4 is the fourth and most recent maintenance release of Python 3.7. The Python 3.7 series is the newest major release of the Python language and contains many new features and optimizations.Among the major new features in Python 3.7 are:PEP 539, new C API for thread-local storage;PEP 545, Python documentation translations;New documentation translations: Japanese, French, and Korean;PEP 552, Deterministic pyc files;PEP 553, Built-in breakpoint();PEP 557, Data Classes;PEP 560, Core support for typing module and generic types;PEP 562, Customization of access to module attributes;PEP 563, Postponed evaluation of annotations;PEP 564, Time functions with nanosecond resolution;PEP 565, Improved DeprecationWarning handling;PEP 567, Context Variables;Avoiding the use of ASCII as a default text encoding (PEP 538, legacy C locale coercion and PEP 540, forced UTF-8 runtime mode);The insertion-order preservation nature of dict objects is now an official part of the Python language spec;Notable performance improvements in many areas.
python报错:Python 2.7 will reach the end of its life on January 1st, 2020.错误描述解决办法     在使用centos7的时候,使用pip安装的时候,可能会报错: DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Pytho 32641
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Pytho Kobe 蔡: 但是我是melodic 用pytho会行吗up主表情包 python虚拟环境卸载及重装 qq_409992227: 这样可能会删不干净,建议重新输入带all的命令删除