python2.7.9(Linux)中pip在哪里

2024-09-28 21:29:10 发布

您现在位置:Python中文网/ 问答频道 /正文

我意识到这个问题可能真的很蠢,但我一辈子都不知道在安装python2.7.9时,我能在哪里找到pip。我知道pip捆绑在这个版本和更高版本中,但是我还是找不到它。我没有常规的写权限,也没有包管理器,所以我从他们的网站下载linux二进制文件来安装python2.7.9

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

那么

^{pr2}$

一切似乎都正常工作,我可以用这种方式安装后运行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

{cdam>出现此错误^:

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

Tags: nameinpyhomegetliblinesoftware
2条回答

我也有同样的问题,但在windows电脑上。以管理员身份重新打开命令提示符,方法是右键单击并以andministrator身份运行,然后尝试

python -m ensurepip

再次工作并成功安装了pip,我现在可以安装其他模块了。在

您可能需要使用^{}包。在

python -m ensurepip

这将安装pip,如果它还没有在那里。在

相关问题 更多 >