########1
(python 虚拟环境(如pycharm 中的 project )是一个独立的环境,所以也要重新安装一次第三方包)
上官网搜索 包
https://pypi.org/project/paramiko/#files
0, 查看已经安装的第三方包
python—>在交互式解释器中输入>>> help("modules")
即可,
效果跟在命令行下输入
$ pydoc modules
是一样的
一、安装
1 pip3 install paramiko
pip install –cacahe-dir . shinken*.tar.gz
进去Linux–python -V不存在则安装,pip的基础环境
python-pip、pyhon的安装,我采用yum安装
检测pip -V 存在与否
pip –help 查看帮助参数
pip install xxx #在线安装的
本地化安装pip资源
pip install –cacahe-dir . shinken*.tar.gz
dir 后面是本地化文件的位置
######2 源文件 安装 python
1.通过读取DB_checklist.xlsx文件,获取巡检项。
2.通过sqlplus登录到数据库执行巡检项。
执行方法:
1.使用setuptools工具安装xlrd模块
1) 安装setuptools工具
gunzip setuptools-2.0.tar.gz
tar -xvf setuptools-2.0.tar
python setup.py build
python setup.py install
2)安装xlrd模块
gunzip xlrd-1.1.0.tar.gz
tar -xvf xlrd-1.1.0.tar
python setup.py install
3)执行巡检脚本
python dbConnect2sqlplus.py
#########3
转载自https://www.douban.com/note/594462204/
感谢前辈总结
一、方法1: 单文件模块
直接把文件拷贝到 $python_dir/Lib
二、方法2: 多文件模块,带setup.py
下载模块包(压缩文件zip或tar.gz),进行解压,CMD->cd进入模块文件夹,执行:
python setup.py install
输入这条命令后,会自动把包安装到E:\Python27\Lib\site-packages中
三、 方法3:easy_install 方式
先下载ez_setup.py,运行python ez_setup 进行easy_install工具的安装,之后就可以使用easy_install进行安装package(文件名称、资源的URL、.egg文件(python egg文件)来下载安装文件)
easy_install packageName
easy_install package.egg
四、 方法4:pip 网络搜索自动安装
先进行pip工具的安裝:easy_install pip(pip 可以通过easy_install 安裝,而且也会装到 Scripts 文件夹下D:\Python2.7\Lib\site-packages)
安裝:pip install PackageName
pip常用命令
列出安装的packages:pip freeze
升级包到当前最新的版本,可以使用-U或者–upgrade:
升级包pip install -U Markdown
卸载包:pip uninstall Markdown
查询包:pip search “Markdown”
五、 方法5:.whl文件pip 方式
下载对应模块.whl文件,在CMD->cd命令下进入到.whl文件所在目录,如果pip目录未添加到环境变量,最好把.whl文件放置到pip.exe所在目录(D:\Python2.7\Scripts\)。
安装: pip install 包名.whl
六、方法6:.exe文件自定义安装
下载对应版本的exe安装文件,如numpy-1.9.2-win32-superpack-python2.7.exe和mlpy-3.5.0.win32-py2.7.exe
安装:打开自动安装即可
———————
本文来自 wzcyy2121 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/wzcyy2121/article/details/79682375?utm_source=copy
F:\tmp\dg巡检>pip install –cache-dir . paramiko-2.4.2.tar.gz
Processing f:\tmp\dg巡检\paramiko-2.4.2.tar.gz
Collecting bcrypt>=3.1.3 (from paramiko==2.4.2)
Downloading https://files.pythonhosted.org/packages/da/e3/50626ef68eaa00ff21aa
36381af902fd90c7a396cc6d1d6fdffb766b7afd/bcrypt-3.1.4-cp36-cp36m-win32.whl
Collecting cryptography>=1.5 (from paramiko==2.4.2)
Retrying (Retry(total=4, cOnnect=None, read=None, redirect=None, status=None))
after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host=’pypi.or
g’, port=443): Read timed out. (read timeout=15)”,)’: /simple/cryptography/
Retrying (Retry(total=3, cOnnect=None, read=None, redirect=None, status=None))
after connection broken by ‘ConnectTimeoutError(
t. (connect timeout=15)’)’: /simple/cryptography/
Downloading https://files.pythonhosted.org/packages/97/49/43a872b608aae588e51b
a31c1be9d46b4fe91c77526a0191a4eafaefa504/cryptography-2.3.1-cp36-cp36m-win32.whl
(1.1MB)
38% |████████████▌ | 419kB 79kB/s eta 0:00:09
39% |████████████▌ | 430kB 71kB/s eta 0:00:10
40% |█████████████ | 440kB 77kB/s eta 0:00:09
41% |█████████████ | 450kB 67kB/s eta 0:00:10
42% |█████████████▌ | 460kB 56kB/s eta 0:00:1
43% |██████████████ | 471kB 62kB/s eta 0:00:1
44% |██████████████ | 481kB 44kB/s eta 0:00:1
45% |██████████████▌ | 491kB 44kB/s eta 0:00:
46% |███████████████ | 501kB 44kB/s eta 0:00:
47% |███████████████ | 512kB 44kB/s eta 0:00:
48% |███████████████▌ | 522kB 47kB/s eta 0:00
49% |████████████████ | 532kB 55kB/s eta 0:00
49% |████████████████ | 542kB 43kB/s eta 0:00
50% |████████████████ | 552kB 53kB/s eta 0:00
51% |████████████████▌ | 563kB 57kB/s eta 0:0
52% |█████████████████ | 573kB 50kB/s eta 0:0
53% |█████████████████ | 583kB 89kB/s eta 0:0
54% |█████████████████▌ | 593kB 85kB/s eta 0:
55% |██████████████████ | 604kB 80kB/s eta 0:
56% |██████████████████ | 614kB 76kB/s eta 0:
57% |██████████████████▌ | 624kB 63kB/s eta 0
58% |███████████████████ | 634kB 63kB/s eta 0
59% |███████████████████ | 645kB 50kB/s eta 0
60% |███████████████████ | 655kB 50kB/s eta 0
61% |███████████████████▌ | 665kB 55kB/s eta
62% |████████████████████ | 675kB 63kB/s eta
63% |████████████████████ | 686kB 63kB/s eta
64% |████████████████████▌ | 696kB 65kB/s eta
65% |█████████████████████ | 706kB 68kB/s eta
65% |█████████████████████ | 716kB 78kB/s eta
66% |█████████████████████▌ | 727kB 92kB/s et
67% |██████████████████████ | 737kB 79kB/s et
68% |██████████████████████ | 747kB 197kB/s e
69% |██████████████████████ | 757kB 141kB/s e
70% |██████████████████████▌ | 768kB 141kB/s
71% |███████████████████████ | 778kB 108kB/s
72% |███████████████████████ | 788kB 55kB/s e
73% |███████████████████████▌ | 798kB 55kB/s
74% |████████████████████████ | 808kB 58kB/s
75% |████████████████████████ | 819kB 57kB/s
76% |████████████████████████▌ | 829kB 60kB/s
77% |█████████████████████████ | 839kB 60kB/s
78% |█████████████████████████ | 849kB 65kB/s
79% |█████████████████████████ | 860kB 62kB/s
80% |█████████████████████████▌ | 870kB 58kB/
81% |██████████████████████████ | 880kB 60kB/
81% |██████████████████████████ | 890kB 92kB/
82% |██████████████████████████▌ | 901kB 85kB
83% |███████████████████████████ | 911kB 85kB
84% |███████████████████████████ | 921kB 71kB
85% |███████████████████████████▌ | 931kB 70k
86% |████████████████████████████ | 942kB 70k
87% |████████████████████████████ | 952kB 61k
88% |████████████████████████████▌ | 962kB 73
89% |████████████████████████████▌ | 972kB 69
90% |█████████████████████████████ | 983kB 77
91% |█████████████████████████████ | 993kB 88
92% |█████████████████████████████▌ | 1.0MB 8
93% |██████████████████████████████ | 1.0MB 8
94% |██████████████████████████████ | 1.0MB 8
95% |██████████████████████████████▌ | 1.0MB
96% |███████████████████████████████ | 1.0MB
97% |███████████████████████████████ | 1.1MB
98% |███████████████████████████████▌| 1.1MB
98% |███████████████████████████████▌| 1.1MB
99% |████████████████████████████████| 1.1MB
100% |████████████████████████████████| 1.1M
B 84kB/s
Collecting pynacl>=1.0.1 (from paramiko==2.4.2)
Downloading https://files.pythonhosted.org/packages/48/f7/71d9d49e73b4b1c2ba96
ec7ea589031f649736b77a8616cb827a430ba9f9/PyNaCl-1.2.1-cp36-cp36m-win32.whl (159k
B)
44% |██████████████▌ | 71kB 71kB/s eta 0:00:0
51% |████████████████▌ | 81kB 67kB/s eta 0:00
57% |██████████████████▌ | 92kB 75kB/s eta 0:
64% |████████████████████▌ | 102kB 73kB/s eta
70% |██████████████████████▌ | 112kB 81kB/s e
77% |████████████████████████▌ | 122kB 76kB/s
83% |███████████████████████████ | 133kB 71kB
89% |█████████████████████████████ | 143kB 83
96% |███████████████████████████████ | 153kB
100% |████████████████████████████████| 163k
B 81kB/s
Collecting pyasn1>=0.1.7 (from paramiko==2.4.2)
Downloading https://files.pythonhosted.org/packages/d1/a1/7790cc85db38daa874f6
a2e6308131b9953feb1367f2ae2d1123bb93a9f5/pyasn1-0.4.4-py2.py3-none-any.whl (72kB
)
42% |█████████████▌ | 30kB 66kB/s eta 0:00:01
56% |██████████████████ | 40kB 69kB/s eta 0:0
70% |██████████████████████▌ | 51kB 59kB/s et
84% |███████████████████████████ | 61kB 70kB/
98% |███████████████████████████████▌| 71kB
100% |████████████████████████████████| 81kB
84kB/s
Collecting six>=1.4.1 (from bcrypt>=3.1.3->paramiko==2.4.2)
Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa
78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting cffi>=1.1 (from bcrypt>=3.1.3->paramiko==2.4.2)
Downloading https://files.pythonhosted.org/packages/05/3f/abc53d8f0c7362181d80
9c913c2b348e41c193eff84c2f0445da2b615f69/cffi-1.11.5-cp36-cp36m-win32.whl (155kB
)
46% |███████████████ | 71kB 69kB/s eta 0:00:0
52% |█████████████████ | 81kB 79kB/s eta 0:00
59% |███████████████████ | 92kB 74kB/s eta 0:
65% |█████████████████████ | 102kB 72kB/s eta
72% |███████████████████████ | 112kB 79kB/s e
78% |█████████████████████████ | 122kB 107kB/
85% |███████████████████████████▌ | 133kB 81k
92% |█████████████████████████████▌ | 143kB 9
98% |███████████████████████████████▌| 153kB
100% |████████████████████████████████| 163k
B 84kB/s
Collecting idna>=2.1 (from cryptography>=1.5->paramiko==2.4.2)
Downloading https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1
af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl (58kB)
52% |█████████████████ | 30kB 85kB/s eta 0:00
70% |██████████████████████▌ | 40kB 66kB/s et
87% |████████████████████████████ | 51kB 74kB
100% |████████████████████████████████| 61kB
73kB/s
Collecting asn1crypto>=0.21.0 (from cryptography>=1.5->paramiko==2.4.2)
Downloading https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a51057
6f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl
(101kB)
50% |████████████████ | 51kB 80kB/s eta 0:00:
60% |███████████████████▌ | 61kB 72kB/s eta 0
70% |██████████████████████▌ | 71kB 69kB/s et
80% |██████████████████████████ | 81kB 79kB/s
90% |█████████████████████████████ | 92kB 74k
100% |████████████████████████████████| 102k
B 73kB/s
Collecting pycparser (from cffi>=1.1->bcrypt>=3.1.3->paramiko==2.4.2)
Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead12
90e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)
45% |██████████████▌ | 71kB 70kB/s eta 0:00:0
51% |████████████████▌ | 81kB 68kB/s eta 0:00
58% |██████████████████▌ | 92kB 76kB/s eta 0:
64% |█████████████████████ | 102kB 72kB/s eta
71% |███████████████████████ | 112kB 80kB/s e
77% |█████████████████████████ | 122kB 74kB/s
84% |███████████████████████████ | 133kB 69kB
90% |█████████████████████████████ | 143kB 80
97% |███████████████████████████████ | 153kB
100% |████████████████████████████████| 163k
B 82kB/s
Installing collected packages: six, pycparser, cffi, bcrypt, idna, asn1crypto, c
ryptography, pynacl, pyasn1, paramiko
Running setup.py install for pycparser … done
Running setup.py install for paramiko … done
Successfully installed asn1crypto-0.24.0 bcrypt-3.1.4 cffi-1.11.5 cryptography-2
.3.1 idna-2.7 paramiko-2.4.2 pyasn1-0.4.4 pycparser-2.19 pynacl-1.2.1 six-1.11.0
F:\tmp\dg巡检>pip install –cache-dir . paramiko-2.4.2.tar.gz
Processing f:\tmp\dg巡检\paramiko-2.4.2.tar.gz
Collecting bcrypt>=3.1.3 (from paramiko==2.4.2)
Downloading https://files.pythonhosted.org/packages/da/e3/50626ef68eaa00ff21aa
36381af902fd90c7a396cc6d1d6fdffb766b7afd/bcrypt-3.1.4-cp36-cp36m-win32.whl
Collecting cryptography>=1.5 (from paramiko==2.4.2)
Retrying (Retry(total=4, cOnnect=None, read=None, redirect=None, status=None))
after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host=’pypi.or
g’, port=443): Read timed out. (read timeout=15)”,)’: /simple/cryptography/
Retrying (Retry(total=3, cOnnect=None, read=None, redirect=None, status=None))
after connection broken by ‘ConnectTimeoutError(
t. (connect timeout=15)’)’: /simple/cryptography/
Downloading https://files.pythonhosted.org/packages/97/49/43a872b608aae588e51b
a31c1be9d46b4fe91c77526a0191a4eafaefa504/cryptography-2.3.1-cp36-cp36m-win32.whl
(1.1MB)
38% |████████████▌ | 419kB 79kB/s eta 0:00:09
39% |████████████▌ | 430kB 71kB/s eta 0:00:10
40% |█████████████ | 440kB 77kB/s eta 0:00:09
41% |█████████████ | 450kB 67kB/s eta 0:00:10
42% |█████████████▌ | 460kB 56kB/s eta 0:00:1
43% |██████████████ | 471kB 62kB/s eta 0:00:1
44% |██████████████ | 481kB 44kB/s eta 0:00:1
45% |██████████████▌ | 491kB 44kB/s eta 0:00:
46% |███████████████ | 501kB 44kB/s eta 0:00:
47% |███████████████ | 512kB 44kB/s eta 0:00:
48% |███████████████▌ | 522kB 47kB/s eta 0:00
49% |████████████████ | 532kB 55kB/s eta 0:00
49% |████████████████ | 542kB 43kB/s eta 0:00
50% |████████████████ | 552kB 53kB/s eta 0:00
51% |████████████████▌ | 563kB 57kB/s eta 0:0
52% |█████████████████ | 573kB 50kB/s eta 0:0
53% |█████████████████ | 583kB 89kB/s eta 0:0
54% |█████████████████▌ | 593kB 85kB/s eta 0:
55% |██████████████████ | 604kB 80kB/s eta 0:
56% |██████████████████ | 614kB 76kB/s eta 0:
57% |██████████████████▌ | 624kB 63kB/s eta 0
58% |███████████████████ | 634kB 63kB/s eta 0
59% |███████████████████ | 645kB 50kB/s eta 0
60% |███████████████████ | 655kB 50kB/s eta 0
61% |███████████████████▌ | 665kB 55kB/s eta
62% |████████████████████ | 675kB 63kB/s eta
63% |████████████████████ | 686kB 63kB/s eta
64% |████████████████████▌ | 696kB 65kB/s eta
65% |█████████████████████ | 706kB 68kB/s eta
65% |█████████████████████ | 716kB 78kB/s eta
66% |█████████████████████▌ | 727kB 92kB/s et
67% |██████████████████████ | 737kB 79kB/s et
68% |██████████████████████ | 747kB 197kB/s e
69% |██████████████████████ | 757kB 141kB/s e
70% |██████████████████████▌ | 768kB 141kB/s
71% |███████████████████████ | 778kB 108kB/s
72% |███████████████████████ | 788kB 55kB/s e
73% |███████████████████████▌ | 798kB 55kB/s
74% |████████████████████████ | 808kB 58kB/s
75% |████████████████████████ | 819kB 57kB/s
76% |████████████████████████▌ | 829kB 60kB/s
77% |█████████████████████████ | 839kB 60kB/s
78% |█████████████████████████ | 849kB 65kB/s
79% |█████████████████████████ | 860kB 62kB/s
80% |█████████████████████████▌ | 870kB 58kB/
81% |██████████████████████████ | 880kB 60kB/
81% |██████████████████████████ | 890kB 92kB/
82% |██████████████████████████▌ | 901kB 85kB
83% |███████████████████████████ | 911kB 85kB
84% |███████████████████████████ | 921kB 71kB
85% |███████████████████████████▌ | 931kB 70k
86% |████████████████████████████ | 942kB 70k
87% |████████████████████████████ | 952kB 61k
88% |████████████████████████████▌ | 962kB 73
89% |████████████████████████████▌ | 972kB 69
90% |█████████████████████████████ | 983kB 77
91% |█████████████████████████████ | 993kB 88
92% |█████████████████████████████▌ | 1.0MB 8
93% |██████████████████████████████ | 1.0MB 8
94% |██████████████████████████████ | 1.0MB 8
95% |██████████████████████████████▌ | 1.0MB
96% |███████████████████████████████ | 1.0MB
97% |███████████████████████████████ | 1.1MB
98% |███████████████████████████████▌| 1.1MB
98% |███████████████████████████████▌| 1.1MB
99% |████████████████████████████████| 1.1MB
100% |████████████████████████████████| 1.1M
B 84kB/s
Collecting pynacl>=1.0.1 (from paramiko==2.4.2)
Downloading https://files.pythonhosted.org/packages/48/f7/71d9d49e73b4b1c2ba96
ec7ea589031f649736b77a8616cb827a430ba9f9/PyNaCl-1.2.1-cp36-cp36m-win32.whl (159k
B)
44% |██████████████▌ | 71kB 71kB/s eta 0:00:0
51% |████████████████▌ | 81kB 67kB/s eta 0:00
57% |██████████████████▌ | 92kB 75kB/s eta 0:
64% |████████████████████▌ | 102kB 73kB/s eta
70% |██████████████████████▌ | 112kB 81kB/s e
77% |████████████████████████▌ | 122kB 76kB/s
83% |███████████████████████████ | 133kB 71kB
89% |█████████████████████████████ | 143kB 83
96% |███████████████████████████████ | 153kB
100% |████████████████████████████████| 163k
B 81kB/s
Collecting pyasn1>=0.1.7 (from paramiko==2.4.2)
Downloading https://files.pythonhosted.org/packages/d1/a1/7790cc85db38daa874f6
a2e6308131b9953feb1367f2ae2d1123bb93a9f5/pyasn1-0.4.4-py2.py3-none-any.whl (72kB
)
42% |█████████████▌ | 30kB 66kB/s eta 0:00:01
56% |██████████████████ | 40kB 69kB/s eta 0:0
70% |██████████████████████▌ | 51kB 59kB/s et
84% |███████████████████████████ | 61kB 70kB/
98% |███████████████████████████████▌| 71kB
100% |████████████████████████████████| 81kB
84kB/s
Collecting six>=1.4.1 (from bcrypt>=3.1.3->paramiko==2.4.2)
Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa
78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting cffi>=1.1 (from bcrypt>=3.1.3->paramiko==2.4.2)
Downloading https://files.pythonhosted.org/packages/05/3f/abc53d8f0c7362181d80
9c913c2b348e41c193eff84c2f0445da2b615f69/cffi-1.11.5-cp36-cp36m-win32.whl (155kB
)
46% |███████████████ | 71kB 69kB/s eta 0:00:0
52% |█████████████████ | 81kB 79kB/s eta 0:00
59% |███████████████████ | 92kB 74kB/s eta 0:
65% |█████████████████████ | 102kB 72kB/s eta
72% |███████████████████████ | 112kB 79kB/s e
78% |█████████████████████████ | 122kB 107kB/
85% |███████████████████████████▌ | 133kB 81k
92% |█████████████████████████████▌ | 143kB 9
98% |███████████████████████████████▌| 153kB
100% |████████████████████████████████| 163k
B 84kB/s
Collecting idna>=2.1 (from cryptography>=1.5->paramiko==2.4.2)
Downloading https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1
af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl (58kB)
52% |█████████████████ | 30kB 85kB/s eta 0:00
70% |██████████████████████▌ | 40kB 66kB/s et
87% |████████████████████████████ | 51kB 74kB
100% |████████████████████████████████| 61kB
73kB/s
Collecting asn1crypto>=0.21.0 (from cryptography>=1.5->paramiko==2.4.2)
Downloading https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a51057
6f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl
(101kB)
50% |████████████████ | 51kB 80kB/s eta 0:00:
60% |███████████████████▌ | 61kB 72kB/s eta 0
70% |██████████████████████▌ | 71kB 69kB/s et
80% |██████████████████████████ | 81kB 79kB/s
90% |█████████████████████████████ | 92kB 74k
100% |████████████████████████████████| 102k
B 73kB/s
Collecting pycparser (from cffi>=1.1->bcrypt>=3.1.3->paramiko==2.4.2)
Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead12
90e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)
45% |██████████████▌ | 71kB 70kB/s eta 0:00:0
51% |████████████████▌ | 81kB 68kB/s eta 0:00
58% |██████████████████▌ | 92kB 76kB/s eta 0:
64% |█████████████████████ | 102kB 72kB/s eta
71% |███████████████████████ | 112kB 80kB/s e
77% |█████████████████████████ | 122kB 74kB/s
84% |███████████████████████████ | 133kB 69kB
90% |█████████████████████████████ | 143kB 80
97% |███████████████████████████████ | 153kB
100% |████████████████████████████████| 163k
B 82kB/s
Installing collected packages: six, pycparser, cffi, bcrypt, idna, asn1crypto, c
ryptography, pynacl, pyasn1, paramiko
Running setup.py install for pycparser … done
Running setup.py install for paramiko … done
Successfully installed asn1crypto-0.24.0 bcrypt-3.1.4 cffi-1.11.5 cryptography-2
.3.1 idna-2.7 paramiko-2.4.2 pyasn1-0.4.4 pycparser-2.19 pynacl-1.2.1 six-1.11.0
F:\tmp\dg巡检>
pip install –download C:\Program Files (x86)\python_3\package -r requirements.txt
pip download D:\offline_packages -r requirements.txt
###########
(https://blog.csdn.net/grllery/article/details/79416494)
镜像:
http://pypi.douban.com/simple/ = https://pypi.tuna.tsinghua.edu.cn/simple
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
########sample for 本地下载,本地安装 download to local to install from local (my prod python is python 3.6)
step 1:
pip download –only-binary=:all: –python-version 36 -d D:\offline_packages paramiko
D:\offline_packages>pip download –only-binary=:all: –python-version 36 -d D:\o
ffline_packages paramiko
Collecting paramiko
Using cached https://files.pythonhosted.org/packages/cf/ae/94e70d49044ccc234bf
dba20114fa947d7ba6eb68a2e452d89b920e62227/paramiko-2.4.2-py2.py3-none-any.whl
Saved d:\offline_packages\paramiko-2.4.2-py2.py3-none-any.whl
Collecting pynacl>=1.0.1 (from paramiko)
Using cached https://files.pythonhosted.org/packages/48/f7/71d9d49e73b4b1c2ba9
6ec7ea589031f649736b77a8616cb827a430ba9f9/PyNaCl-1.2.1-cp36-cp36m-win32.whl
Saved d:\offline_packages\pynacl-1.2.1-cp36-cp36m-win32.whl
Collecting cryptography>=1.5 (from paramiko)
Using cached https://files.pythonhosted.org/packages/97/49/43a872b608aae588e51
ba31c1be9d46b4fe91c77526a0191a4eafaefa504/cryptography-2.3.1-cp36-cp36m-win32.wh
l
Saved d:\offline_packages\cryptography-2.3.1-cp36-cp36m-win32.whl
Collecting bcrypt>=3.1.3 (from paramiko)
Using cached https://files.pythonhosted.org/packages/da/e3/50626ef68eaa00ff21a
a36381af902fd90c7a396cc6d1d6fdffb766b7afd/bcrypt-3.1.4-cp36-cp36m-win32.whl
Saved d:\offline_packages\bcrypt-3.1.4-cp36-cp36m-win32.whl
Collecting pyasn1>=0.1.7 (from paramiko)
Using cached https://files.pythonhosted.org/packages/d1/a1/7790cc85db38daa874f
6a2e6308131b9953feb1367f2ae2d1123bb93a9f5/pyasn1-0.4.4-py2.py3-none-any.whl
Saved d:\offline_packages\pyasn1-0.4.4-py2.py3-none-any.whl
Collecting six (from pynacl>=1.0.1->paramiko)
Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bf
a78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Saved d:\offline_packages\six-1.11.0-py2.py3-none-any.whl
Collecting cffi>=1.4.1 (from pynacl>=1.0.1->paramiko)
Using cached https://files.pythonhosted.org/packages/05/3f/abc53d8f0c7362181d8
09c913c2b348e41c193eff84c2f0445da2b615f69/cffi-1.11.5-cp36-cp36m-win32.whl
Saved d:\offline_packages\cffi-1.11.5-cp36-cp36m-win32.whl
Collecting idna>=2.1 (from cryptography>=1.5->paramiko)
Using cached https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c
1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl
Saved d:\offline_packages\idna-2.7-py2.py3-none-any.whl
Collecting asn1crypto>=0.21.0 (from cryptography>=1.5->paramiko)
Using cached https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a5105
76f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl
Saved d:\offline_packages\asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.4.1->pynacl>=1.0.1->paramiko)
Could not find a version that satisfies the requirement pycparser (from cffi>=
1.4.1->pynacl>=1.0.1->paramiko) (from versions: )
No matching distribution found for pycparser (from cffi>=1.4.1->pynacl>=1.0.1->p
aramiko)
D:\offline_packages>
(https://blog.csdn.net/github_35160620/article/details/52203682)
step 2:
download the missing package pycparser package in https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
(pycparser‑2.19‑py2.py3‑none‑any.whl)
(ref 现在你能看到下面的 opencv 版本,因为我使用的是 Python 3.5.0 版本,并且我的电脑是64位的,所以我选择下载:opencv_python-3.1.0-cp35-cp35m-win_amd64.whl
https://blog.csdn.net/github_35160620/article/details/52203682)
(https://stackoverflow.com/questions/37125823/pip-could-not-find-a-that-satisfies-the-requirement
ref pygame is not distributed via pip. See this link which provides windows binaries ready for installation.
Install python
Make sure you have python on your PATH
Download the appropriate wheel from this link
Install pip using this tutorial
Finally, use these commands to install pygame wheel with pip
Python 2 (usually called pip)
pip install file.whl
Python 3 (usually called pip3)
pip3 install file.whl
Another tutorial for installing pygame for windows can be found here. Although the instructions are for 64bit windows, it can still be applied to 32bit
)
step 3:
pip install –no-index –find-links=D:\offline_packages paramiko
D:\offline_packages>pip install –no-index –find-links=D:\offline_packages paramiko
Looking in links: D:\offline_packages
Collecting paramiko
Collecting bcrypt>=3.1.3 (from paramiko)
Requirement already satisfied: pyasn1>=0.1.7 in c:\program files (x86)\python_3\
lib\site-packages (from paramiko) (0.4.4)
Requirement already satisfied: cryptography>=1.5 in c:\program files (x86)\pytho
n_3\lib\site-packages (from paramiko) (2.3.1)
Requirement already satisfied: pynacl>=1.0.1 in c:\program files (x86)\python_3\
lib\site-packages (from paramiko) (1.2.1)
Requirement already satisfied: six>=1.4.1 in c:\program files (x86)\python_3\lib
\site-packages (from bcrypt>=3.1.3->paramiko) (1.11.0)
Collecting cffi>=1.1 (from bcrypt>=3.1.3->paramiko)
Requirement already satisfied: idna>=2.1 in c:\program files (x86)\python_3\lib\
site-packages (from cryptography>=1.5->paramiko) (2.7)
Requirement already satisfied: asn1crypto>=0.21.0 in c:\program files (x86)\pyth
on_3\lib\site-packages (from cryptography>=1.5->paramiko) (0.24.0)
Collecting pycparser (from cffi>=1.1->bcrypt>=3.1.3->paramiko)
Installing collected packages: pycparser, cffi, bcrypt, paramiko
Successfully installed bcrypt-3.1.4 cffi-1.11.5 paramiko-2.4.2 pycparser-2.19
#########################
################sample 本地下载,迁移到测试机上安装 download to package to local and move to test machine and isntall
step 1:
–pip download –only-binary=:all: –python-version 27 –platform win32 -d D:\offline_packages\1 paramiko
or
–pip download –only-binary=:all: –python-version 2 –platform win32 -d D:\offline_packages\2 -i https://pypi.tuna.tsinghua.edu.cn/simple paramiko
–( when add parameter –only-binary and –python-version it will report error as belows:)
(Could not find a version that satisfies the requirement pynacl>=1.0.1 (from pa
ramiko) (from versions: )
No matching distribution found for pynacl>=1.0.1 (from paramiko))
—-change to :
—pip download -d D:\offline_packages\3 paramiko
step 1 可能会遇见报错 for No matching distribution found for ****.**** ,请参考后继的解决方法 深度查找方法
###可以指定 软件对应的 版本号
##pip download –only-binary=:all: –platform win32 –python-version 27 –implementation cp -d D:\offline_paces\5 django==1.6.11
(注意,处理-d 只有一个- 之外,其他命令都有两个-)
C:\Users\dbdd>pip download –only-binary=:all: –platform win32 –python-version 27 –implementation cp -d D:\offline_paces\4 paramiko
Collecting paramiko
Using cached https://files.pythonhosted.org/packages/cf/ae/94e70d49044ccc234bf
dba20114fa947d7ba6eb68a2e452d89b920e62227/paramiko-2.4.2-py2.py3-none-any.whl
Saved d:\offline_paces\4\paramiko-2.4.2-py2.py3-none-any.whl
Collecting pynacl>=1.0.1 (from paramiko)
Downloading https://files.pythonhosted.org/packages/6e/41/fb56e3b439c4a0339030
b9da471516f238dc8a34bb389bfd15606618084d/PyNaCl-1.0.1-cp27-none-win32.whl (103kB
)
49% |████████████████ | 51kB 62kB/s eta 0:00:
59% |███████████████████ | 61kB 74kB/s eta 0:
69% |██████████████████████ | 71kB 70kB/s eta
79% |█████████████████████████ | 81kB 66kB/s
88% |████████████████████████████▌ | 92kB 74k
98% |███████████████████████████████▌| 102kB
100% |████████████████████████████████| 112k
B 81kB/s
Saved d:\offline_paces\4\pynacl-1.0.1-cp27-none-win32.whl
Collecting cryptography>=1.5 (from paramiko)
Could not find a version that satisfies the requirement cryptography>=1.5 (fro
m paramiko) (from versions: 0.2, 0.2.1, 0.2.2, 0.3, 0.4, 0.5, 0.5.1, 0.5.2, 0.5.
3, 0.5.4, 0.6, 0.6.1, 0.7, 0.7.1, 0.7.2, 0.8, 0.8.1, 0.8.2, 0.9, 0.9.1, 0.9.2, 0
.9.3, 1.0, 1.0.1, 1.0.2, 1.1, 1.1.1, 1.1.2, 1.2, 1.2.1, 1.2.2, 1.2.3, 1.3, 1.3.1
, 1.3.2, 1.3.3, 1.3.4, 1.4)
No matching distribution found for cryptography>=1.5 (from paramiko)
solution : 使用深度寻找方法:
step 1.1:
download cryptography manule in site with version 1.5
for expample : http://pypi.doubanio.com/simple/cryptography/ serche key:1.5
step 1.2:continue download
pip download –only-binary=:all: –platform win32 –python-version 27 –implementation cp -d D:\offline_paces\4 cryptography
Collecting pycparser (from cffi>=1.4.1->cryptography)
Could not find a version that satisfies the requirement pycparser (from cffi>=
1.4.1->cryptography) (from versions: )
No matching distribution found for pycparser (from cffi>=1.4.1->cryptography)
step 1.3: manule download pycparser in site , it is rar file.
http://pypi.doubanio.com/simple/pycparser
step 1.4. 到这里结束了,因为只到了没有到 子级别的 查找了,没有进一步寻找的必要了。
pip download –only-binary=:all: –platform win32 –python-version 27 –implementation cp -d D:\offline_paces\4 pycparser
No matching distribution found for pycparser
—step 2: for all the package if it is py3 only or cp3 or cp36 or rar , try to from mirror find py2 support whl file:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
or
http://pypi.doubanio.com/simple
or
https://pypi.tuna.tsinghua.edu.cn/simple
PyNaCl ,cryptography,cffi,bcrypt
(serch key 版本号 serche key:1.5 and make suere win32 or amd64 py version is ok)
D:\offline_packages\3
step 3: copy to test machine ,最好将这些二进制文件 pip 可执行的目录下 (比如 放在 D:\Python2.7\Scripts\),(安装完毕可以删除这些二进制文件。)
pip install –no-index –find-links= D:\Python2.7\Scripts\ paramiko
(.whl文件pip 方式
下载对应模块.whl文件,在CMD->cd命令下进入到.whl文件所在目录,如果pip目录未添加到环境变量,最好把.whl文件放置到pip.exe所在目录(D:\Python2.7\Scripts\)。)
########uninstalll
D:\offline_packages>pip uninstall pycparser
Uninstalling pycparser-2.19:
Would remove:
c:\program files (x86)\python_3\lib\site-packages\pycparser-2.19-py3.6.egg-i
nfo
c:\program files (x86)\python_3\lib\site-packages\pycparser\*
C:\Users\hs.hs>pip uninstall
You must give at least one requirement to uninstall (see “pip help uninstall”)
C:\Users\hs.hs>pip uninstall paramiko
Uninstalling paramiko-2.4.2:
Would remove:
c:\program files (x86)\python_3\lib\site-packages\paramiko-2.4.2-py3.6.egg-
nfo
c:\program files (x86)\python_3\lib\site-packages\paramiko\*
Proceed (y/n)? y
Successfully uninstalled paramiko-2.4.2
C:\Users\hs.hs>pip list
Package Version
———— ——-
asn1crypto 0.24.0
bcrypt 3.1.4
cffi 1.11.5
cryptography 2.3.1
idna 2.7
pip 18.0
pyasn1 0.4.4
pycparser 2.19
PyNaCl 1.2.1
setuptools 28.8.0
six 1.11.0
Trac 1.2.2
C:\Users\hs.hs>pip uninstall cffi
Uninstalling cffi-1.11.5:
Would remove:
c:\program files (x86)\python_3\lib\site-packages\_cffi_backend.cp36-win32.
yd
c:\program files (x86)\python_3\lib\site-packages\cffi-1.11.5.dist-info\*
c:\program files (x86)\python_3\lib\site-packages\cffi\*
Proceed (y/n)? y
Successfully uninstalled cffi-1.11.5
C:\Users\hs.hs>pip uninstall bcrypt
Uninstalling bcrypt-3.1.4:
Would remove:
c:\program files (x86)\python_3\lib\site-packages\bcrypt-3.1.4.dist-info\*
c:\program files (x86)\python_3\lib\site-packages\bcrypt\*
Proceed (y/n)? y
Successfully uninstalled bcrypt-3.1.4
C:\Users\hs.hs>