Mac上,python多版本共存(非切换)

2022-08-08 08:48:08 浏览数 (3)

最近需求是要抓取线上视频,要用到you-get,一看wiki,干,要用到3.0,一直是2.7的忠实拥趸,又不想来回切换版本太麻烦,能不能共存呢?答案当然是可以啦,命令如下,以后想用3.0,直接在命令行下打/python3就可以啦,美滋滋

代码语言:javascript复制
# wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz

# mkdir /usr/local/python3 

# tar -zxvf Python-3.7.3.tgz

# cd Python-3.7.3

# ./configure --prefix=/usr/local/python3

# sudo make install

# ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3  (/usr/local/bin/python3)

# ln -s /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 

# /usr/bin/python3

0 人点赞