Total Pageviews

Saturday, 16 November 2024

安装python2,python2版的pip和setuptools

  现在的linux发行版是自带python3,而不自带python2了。但以前的一些基于python的程序是基于python2开发的,用python3运行是会出错的,所以有必要搭建python2环境。

 登录linux vps,

apt-get install python2 -y
wget  https://bootstrap.pypa.io/pip/2.7/get-pip.py
python2 get-pip.py (然后就能成功安装python2版的pip和setuptools)
显示:
Collecting pip<21.0
  Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 3.6 MB/s
Collecting setuptools<45
  Downloading setuptools-44.1.1-py2.py3-none-any.whl (583 kB)
     |████████████████████████████████| 583 kB 32.0 MB/s
Collecting wheel
  Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-20.3.4 setuptools-44.1.1 wheel-0.37.1

root@racknerd-626f077:~# which pip2
/usr/local/bin/pip2
root@racknerd-626f077:~# pip2 install markdown

No comments:

Post a Comment