1

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.

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

Thanks.

2 Answers 2

3

pip will only install to one python environment.

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

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

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

See this question for details about installing pip

Sign up to request clarification or add additional context in comments.

1 Comment

For future reference: the package in question is extras/python2-pip
2

I think what you need is virtualenv https://pypi.python.org/pypi/virtualenv . virtualenv is a tool to create isolated Python environments

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.