Heim  >  Fragen und Antworten  >  Hauptteil

linux - Was muss noch getan werden, um get-pip.py mit einer Nicht-Systemversion von Python auszuführen?

Da die Arbeitsumgebung centos6.X ist und das mit dem System gelieferte Python 2.6 ist, werden viele neue Module nicht sehr gut unterstützt. Laden Sie also Python2.7.13 herunter, kompilieren Sie es und verknüpfen Sie es dann mit dem Befehl Python2.7. Nachdem Sie get-pip.py heruntergeladen und mit Python2.7 ausgeführt haben, werden Sie aufgefordert, es unter site-packages im Python2.7-Installationsverzeichnis zu installieren. Der Befehl wurde jedoch bei der Eingabe von pip nicht gefunden (es sollte eine Nicht-Systemversion sein und es wurde keine Verbindung hergestellt). Ich würde gerne fragen, wie ich jetzt vorgehen soll. pip muss nur Module für Python2.7 installieren, und das native Python des Systems wird es nicht berühren.

世界只因有你世界只因有你2692 Tage vor898

Antworte allen(3)Ich werde antworten

  • PHP中文网

    PHP中文网2017-06-05 11:13:20

    python多版本管理工具,推荐使用pyenv

    Antwort
    0
  • phpcn_u1582

    phpcn_u15822017-06-05 11:13:20

    你完全可以给python2.7对应的pip做一个软连接叫pip27, 别和系统默认那个冲突就好, 想安装模块用pip27就可以安装到python27上面了

    Antwort
    0
  • 我想大声告诉你

    我想大声告诉你2017-06-05 11:13:20

    1. 你要知道你用的 pip 在什么地方,有没有加到环境变量里面

    2. 你可以使用 python(27 版本的 python) -m pip 来调用 pip

    3. 你也可以改 python 软连接, 但是可能有有风险, 因为有的系统软件可能用的系统的 python,所以用 python27 这样的软连是比较好的方法

    4. 使用 pyenv, 但是也是要注意,他可能会修改系统 python,他还有 python shell/local/global 配置。

    Antwort
    0
  • StornierenAntwort