简体   繁体   中英

Python site packages: How can I maintain for both 2.x and 3.x version

I understand that we can install different version of Python on a same box - but there are packages that are not supported common to both.

So if I have two version of Python(2.x and 3.x) installed how can I automatically have packages deployed correctly for each version of Python using pip?

我不知道您是否可以配置pip来自动安装多个Python版本的软件包,但是在命令行上手动指定两个软件包很容易,并且编写一个可以正确多次调用pip的脚本很简单。 Python版本。

At least on Arch Linux, and presumably on other distros, there are two separate packages for pip, which if both installed give you two different commands: pip and pip3. Running pip ... will always install to the Python 2 site-packages, and pip3 ... to the Python 3 site-packages. This works both for system-wide packages (running as root) or for installing them into your home directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM