惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
L
LINUX DO - 热门话题
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
Cisco Talos Blog
Cisco Talos Blog
AI
AI
L
LINUX DO - 最新话题
H
Heimdal Security Blog
Hacker News: Ask HN
Hacker News: Ask HN
Webroot Blog
Webroot Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The GitHub Blog
The GitHub Blog
I
Intezer
Blog — PlanetScale
Blog — PlanetScale
有赞技术团队
有赞技术团队
S
Securelist
博客园_首页
IT之家
IT之家
Schneier on Security
Schneier on Security
博客园 - 叶小钗
罗磊的独立博客
WordPress大学
WordPress大学
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
W
WeLiveSecurity
The Register - Security
The Register - Security
D
DataBreaches.Net
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
Recorded Future
Recorded Future
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tailwind CSS Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
T
Tor Project blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com

博客园 - 疯吻IT

timestamp for this request was 1000ms ahead of the server's time GitHub无法访问、443 Operation timed out的解决办法 - 疯吻IT Ccxt: ModuleNotFoundError:没有名为“ ccxt”的模块 机器翻译数据集 CENTOS手动安装修复python ,YUM CENTOS手动安装修复YUM Python3 找不到库 UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 0: ordinal not in range(128) 数据集 rnn_model.fit Incompatible shapes Mysql 密码过期 帝国cms打开慢 如何快速获得权重站 HTTP 404 Not Found Error with .woff or .woff2 Font Files php报错 syntax error, unexpected T_VARIABLE 修改帝国cms栏目后,如何更新 用python 发 帝国cms 文章 帝国cms更新报错解决办法 帝国cms 不能正常显示最新文章 帝国CMS Table '***.phome_ecms_news_data_' doesn't exist python 去重
多版本python及多版本pip使用
疯吻IT · 2018-09-26 · via 博客园 - 疯吻IT

最近做一些网站的发布程序,要用到python3,所以又安装了python3。

www.qlrx.net
www.393662.com
www.qnpx.net
www.393225.com

1. 多版本python

Windows 上的 Python 自带启动器 py.exe,默认安装到系统盘的 system32 文件夹里。如果你同时安装了 Python 2 和 Python 3,用的时候直接在终端里输入:

就是打开 Python 3 的 REPL,或者

就可以运行 Python 3 的脚本了。
同理,直接输入

使用 Python 2 来运行脚本。

2. 多版本pip

当Python2和Python3同时存在于windows上时,它们对应的pip都叫pip.exe,所以不能够直接使用 pip install 命令来安装软件包。而是要使用启动器py.exe来指定pip的版本。命令如下:


py -2 -m pip install XXXX

-2 还是表示使用 Python2,-m pip 表示运行 pip 模块,也就是运行pip命令了。如果是为Python3安装软件,那么命令类似的变成


py -3 -m pip install XXXX