Pip install for both pythons

前端 未结 2 1605
感动是毒
感动是毒 2021-01-16 15:23

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

相关标签:
2条回答
  • 2021-01-16 15:39

    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

    0 讨论(0)
  • 2021-01-16 15:55

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

    0 讨论(0)
提交回复
热议问题