我安装了Python 3.x(除了Ubuntu上的Python 2.x),然后慢慢开始配对我在Python 2.x中使用的模块.
I installed Python 3.x (besides Python 2.x on Ubuntu) and slowly started to pair modules I use in Python 2.x.
所以我想知道,应该为Python 2.x和Python 3.x使用pip来简化生活吗?
So I wonder, what approach should I take to make my life easy by using pip for both Python 2.x and Python 3.x?
推荐答案您应该采取的方法是为Python 3.2安装pip.
The approach you should take is to install pip for Python 3.2.
您可以通过以下方式进行操作:
You do this in the following way:
$ curl -O bootstrap.pypa.io/get-pip.py $ sudo python3.2 get-pip.py然后,您可以使用pip-3.2安装适用于Python 3.2的内容,并使用pip-2.7安装适用于Python 2-7的内容. pip命令最终将指向其中之一,但是我不确定是哪一个,因此您必须进行检查.
Then, you can install things for Python 3.2 with pip-3.2, and install things for Python 2-7 with pip-2.7. The pip command will end up pointing to one of these, but I'm not sure which, so you will have to check.
更多推荐
如何在Python 3.x和Python 2.x上使用pip
发布评论