gpt4 book ai didi

python - Python 2.7.9 (Linux) 中的 pip 在哪里

转载 作者:可可西里 更新时间:2023-11-01 11:49:01 24 4
gpt4 key购买 nike

我意识到这个问题可能真的很愚蠢,但我终究无法弄清楚在安装 python 2.7.9 时在哪里可以找到 pip。我知道pip在这个及以上的版本中是捆绑的,但我还是找不到。我没有常规的写入权限,也没有包管理器,所以我通过从他们的网站下载 linux 二进制文件来安装 Python 2.7.9,然后

./configure --prefix=/home/me/software/python-2.7.9/myinstall/

然后

make; make install

一切似乎都正常工作,我可以在这样安装后运行 python,但是找不到 pip。任何帮助将不胜感激。

更新

运行 python get-pip.py 会产生以下错误消息:

ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
File "get-pip.py", line 20204, in <module>
main()
File "get-pip.py", line 152, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
import pip
File "/tmp/tmpGmhhtn/pip.zip/pip/__init__.py", line 15, in <module>
File "/tmp/tmpGmhhtn/pip.zip/pip/vcs/mercurial.py", line 11, in <module>
File "/tmp/tmpGmhhtn/pip.zip/pip/download.py", line 30, in <module>
File "/tmp/tmpGmhhtn/pip.zip/pip/_vendor/__init__.py", line 81, in load_module
ImportError: No module named 'pip._vendor.requests'

(对不起,长度)。

更新2

运行 python -m ensurepip -vvv -U 我得到这个错误:

ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/me/software/Python-2.7.9/_centos5/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
Ignoring ensurepip failure: pip 1.5.6 requires SSL/TLS

最佳答案

您可能需要使用 ensurepip包。

python -m ensurepip

如果 pip 不存在,这将安装它。

关于python - Python 2.7.9 (Linux) 中的 pip 在哪里,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28751541/

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