我正在通过SSH和OPENVPN控制远程单元。
在远程单元上,我想使用pip但安装一些Python软件包:
pip);减少尝试时间(我不是系统管理员,我对此主题的了解非常有限),其想法是打开一个显而易见的SSH端口转发:
ssh -R 9999:pypi.python.org:443 xxxx@XX.XX.XX.XX
然后,在远程单元上播放pip install:
pip install pymodbus==1.3.2 --proxy localhost:9999
但是此命令返回:
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement pymodbus==1.3.2
Run Code Online (Sandbox Code Playgroud)
/root/.pip/pip.log 是:
Getting page https://pypi.python.org/simple/pymodbus/
Could not fetch URL https://pypi.python.org/simple/pymodbus/: connection error: ('Connection aborted.', BadStatusLine("''",))
Will skip URL https://pypi.python.org/simple/pymodbus/ when looking for download links for pymodbus==1.3.2
Getting page https://pypi.python.org/simple/
Could not fetch URL https://pypi.python.org/simple/: connection error: ('Connection aborted.', BadStatusLine("''",))
Will skip URL https://pypi.python.org/simple/ when looking for download links for pymodbus==1.3.2
Cannot fetch index base URL https://pypi.python.org/simple/
URLs to search for versions for pymodbus==1.3.2:
* https://pypi.python.org/simple/pymodbus/1.3.2
* https://pypi.python.org/simple/pymodbus/
Getting page https://pypi.python.org/simple/pymodbus/1.3.2
Could not fetch URL https://pypi.python.org/simple/pymodbus/1.3.2: connection error: ('Connection aborted.', BadStatusLine("''",))
Will skip URL https://pypi.python.org/simple/pymodbus/1.3.2 when looking for download links for pymodbus==1.3.2
Getting page https://pypi.python.org/simple/pymodbus/
Run Code Online (Sandbox Code Playgroud)
很明显,由于拒绝连接,远程单元无法读取pypi.pthon.org上的索引页。
我想要达到的正确语法是什么?
小智 2
代理将会很棘手。我建议您 scp pip 模块源文件并从源代码本地安装它。使用
pip install package \xe2\x80\x94download="/pth/to/downloaded/file\xe2\x80\x9d 获取包,将其 scp 到目标服务器并使用 pip install \xe2\x80\x9c/pth /到/scp/文件\xe2\x80\x9d
| 归档时间: |
|
| 查看次数: |
1597 次 |
| 最近记录: |