我无法使用pip安装pexpect。这是错误:
$ sudo -H pip install pexpect
Collecting pexpect
Could not find a version that satisfies the requirement pexpect (from
versions: )
No matching distribution found for pexpect
$ sudo -H pip install --upgrade pip
Requirement already up-to-date: pip in /Library/Python/2.7/site-
packages
$ python --version
Python 2.7.10
有人可以指出我可能是什么问题吗? 感谢
我也试过brew和easy_install。他们都没有工作:
$ sudo -H easy_install pexpect
Searching for pexpect
Reading https://pypi.python.org/simple/pexpect/
Download error on https://pypi.python.org/simple/pexpect/: [SSL:
TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)
-- Some packages may not be found!
Couldn't find index page for 'pexpect' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [SSL:
TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)
-- Some packages may not be found!
No local packages or download links found for pexpect
error: Could not find suitable distribution for
Requirement.parse('pexpect')
$ brew install pexpect
Error: No available formula with the name "pexpect"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
==> Searching local taps...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
我查看了网站:https://pypi.python.org/simple/pexpect/。我没有看到python 2.7版本的文件。这可能是原因。有谁知道我怎么能得到Python 2.7或任何其他解决方案。
答案 0 :(得分:0)
我在全新安装中发现了奇怪的结果。在运行python之前,我无法使用pip3进行任何安装。跑了python -V
,然后没问题。
答案 1 :(得分:-1)
pip 直到升级才安装。
我首先必须使用以下命令更新pip
:
sudo pip install --upgrade pip
如果pip
在第一次尝试时未正确upgrade
,请重新运行命令。
pip
成功升级后,安装pexpect
简直是小菜一碟。