gpt4 book ai didi

Python 和 Pip 不同步

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:43:32 27 4
gpt4 key购买 nike

我正在使用预装了 python 2.7.6 的远程 linux 服务器。我想升级到 python 2.7.12(因为下面显示的一些ssl 错误,我无法在 2.7.6 上安装一些库)。

我从源代码下载并编译并安装了 2.7.12,python2.7 打开了 2.7.12。但是,我在使用 pip 时仍然收到更新 python 版本警告。 pip 似乎没有与 2.7.12 同步并继续为 2.7.6 服务,我无法在系统中找到 pip 的其他安装。

我只想要一个 python2.7.x 的工作版本,pip/pip2/pip2.7 可以正常工作。

    /usr/local/lib/python2.7/dist-packages/pip-8.1.2-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip-8.1.2-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning

最佳答案

以这种方式升级(并自动重新安装)pip:

/path/to/python2.7.12 -m pip install pip --upgrade

-m 标志加载相应的模块,在 pip 的情况下将执行 pip(感谢 the power of the __main__ module inside the package)。

安装后,您当前的 pip 也应该是最新的。


或者,你可以运行

/path/to/python2.7.12 /path/to/pip2 install pip --upgrade

注意:请注意您正在运行的 pippython2:可能会有一个 /usr/bin/python和/usr/bin/pip在你安装的那些旁边/usr/local//usr/bin` 中的那些应该只在标准系统更新之后更新,如果有的话。

关于Python 和 Pip 不同步,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40035830/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com