我们要通过pip安装Jinja2-2.10-py2.py3-none-any.whl软件包-在新的REDHAT OS(版本7.2)上
pip install Jinja2-2.10-py2.py3-none-any.whl
Processing ./Jinja2-2.10-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from Jinja2==2.10)
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-3, 'Temporary failure in name resolution'))': /simple/markupsafe/
当我们要通过pip安装-Jinja2-2.10-py2.py3-none-any.whl软件包时,我不明白为什么pip失败并显示“名称解析中的临时故障”?
我们还尝试了以下尝试,但没有成功:
pip install --no-index --find-links Jinja2-2.10-py2.py3-none-any.whl
Ignoring indexes: https://pypi.python.org/simple
You must give at least one requirement to install (maybe you meant "pip install Jinja2-2.10-py2.py3-none-any.whl"?)
pip install --no-index /tmp/install/Jinja2-2.10-py2.py3-none-any.whl
Ignoring indexes: https://pypi.python.org/simple
Processing ./Jinja2-2.10-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from Jinja2==2.10)
Could not find a version that satisfies the requirement MarkupSafe>=0.23 (from Jinja2==2.10) (from versions: )
No matching distribution found for MarkupSafe>=0.23 (from Jinja2==2.10)
pip install -U Jinja2-2.10-py2.py3-none-any.whl
Processing ./Jinja2-2.10-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from Jinja2==2.10)
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', gaierror(-3, 'Temporary failure in name resolution'))': /simple/markupsafe/
pip install -e Jinja2-2.10-py2.py3-none-any.whl
Jinja2-2.10-py2.py3-none-any.whl should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+
在这种情况下为PIP-是本地文件夹
pip install -e PIP/Jinja2-2.10-py2.py3-none-any.whl
PIP/Jinja2-2.10-py2.py3-none-any.whl should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+
更新
[root@Master install_zone]# ls PIP/
Jinja2-2.10-py2.py3-none-any.whl
[root@Master install_zone]# pip install --no-index --find-links=./PIP Jinja2
Ignoring indexes: https://pypi.python.org/simple
Collecting Jinja2
Collecting MarkupSafe>=0.23 (from Jinja2)
Could not find a version that satisfies the requirement MarkupSafe>=0.23 (from Jinja2) (from versions: )
No matching distribution found for MarkupSafe>=0.23 (from Jinja2)
[root@Master install_zone]#
我们以以下方式检查解析:(详细信息来自/etc/resolv.conf)
[root@Master install_zone]# host sys54.com
sys54.com has address 32.44.1.154
[root@Master install_zone]# host 32.44.1.154
17.2.21.10.in-addr.arpa domain name pointer mpsload.sys54.com.
答案 0 :(得分:0)
您的命令略有错误,find-links
参数应指向软件包所在的目录,而不是软件包本身:
-f,--find-links如果是html文件的url或路径,则 解析到存档的链接。如果是本地路径或file://网址, 目录,然后在以下位置查找档案 目录列表。
pip install --no-index --find-links Jinja2-2.10-py2.py3-none-any.whl
上方指示pip在Jinja2-2.10-py2.py3-none-any.whl
目录中查找软件包,但是您没有告诉pip安装什么。
假设您已将文件下载到名为PIP的子目录中,则命令应为:pip install --no-index --find-links=./PIP Jinja2