有任务需求要用python来实现sftp功能,然而服务器是在内网的,没有互联网环境,要自己逐个安装模块,很蛋疼。
顺便总结一下安装新模块的几个方法:
1 联网情况下,我一般用pip(老版本的可能会用easy_install)
2 非联网情况下,从别的可以上网的机器在网上下载相应模块包,推荐先上这 https://pypi.python.org/pypi 找,在相应目录里使用命令python setup.py build/install
离线安装paramiko的9个步骤 (py2.7)
这是当时参考的,不过期间还有点小坑(可能因为我用的py3.6)
./opt/bin/easy_install pyasn1-0.1.9-py2.7.egg
./opt/bin/pip install ipaddress-1.0.17-py2-none-any.whl
./opt/bin/pip install enum34-1.1.6-py2-none-any.whl
./opt/bin/pip install six-1.10.0-py2.py3-none-any.whl
./opt/bin/pip install idna-2.1-py2.py3-none-any.whl
tar axf pycparser-2.17.tar.gz
cd pycparser-2.17
../opt/bin/python setup.py install
./opt/bin/pip install cffi-1.9.1-cp27-cp27m-manylinux1_x86_64.whl
tar axf cryptography-1.6.tar.gz
cd cryptography-1.6
../opt/bin/python setup.py install
./opt/bin/pip install paramiko-2.0.2-py2.py3-none-any.whl
Python模块常用的几种安装方式
https://www.cnblogs.com/goodge/articles/5596567.html
easy_install与pip 区别
http://blog.csdn.net/xifeijian/article/details/12576455
离线安装 Python 2.7, paramiko 和 tornado
https://www.cnblogs.com/senjougahara/p/6090000.html
Python3之paramiko模块
https://www.cnblogs.com/wang-yc/p/5628114.html