两个Python的Pip安装 [英] Pip install for both pythons

查看:93
本文介绍了两个Python的Pip安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是pip的新手,并且已经使用它在我的系统上成功安装了一些模块(例如pyglet). 我有2个版本的python,2.7和3.当我使用python3时,pyglet可以正常工作,但是在python2中,它告诉我找不到模块pyglet.

I'm new to pip and I've use it to install some module on my system, say pyglet, successfully. I have 2 versions of python, 2.7 and 3. When I use python3, pyglet works fine, but in python2, it tells me module pyglet not found.

如何将pip安装到python2和python3上?

How can I pip install to both of python2 and python3?

谢谢.

推荐答案

pip将仅安装到一个python环境.

pip will only install to one python environment.

听起来pip已安装到您的python3环境中,您需要再次安装到python2.

It sounds like pip has installed to your python3 environment and you need to install again to python2.

pip脚本知道#号中的python将安装哪个python!线

The pip script knows which python it is to installs for by the python in the #! line

要获取python 2的pip,要么您的计算机上已经有一个pip2 *脚本,要么您需要为python2安装pip

To get a pip for your python 2 either there is already a pip2* script on your machine or you will need to install pip for python2

请参见问题以获取有关安装pip的详细信息

See this question for details about installing pip

这篇关于两个Python的Pip安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆