天天看點

python 安裝 第三方包

#####linux 下安裝pip

感謝尚

https://www.php.cn/python-tutorials-424350.html

https://pypi.org/project/pip/#files

1.下載下傳 pip-20.3.3-py2.py3-none-any.whl

2.python 指令安裝pip 包

python pip-20.3.3-py2.py3-none-any.whl/pip install pip-20.3.3-py2.py3-none-any.whl

如果有多個python 環境,比如python 27 裝在另外目錄下 /home/ansible/python27/bin/python

 /home/ansible/python27/bin/python pip-20.3.3-py2.py3-none-any.whl/pip install pip-20.3.3-py2.py3-none-any.whl

 裝好之後;pip s所在的檔案夾就在

 /home/ansible/python27/bin/pip 目錄下

########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

  1. 進去Linux--python  -V不存在則安裝,pip的基礎環境
    python 安裝 第三方包
  2. python-pip、pyhon的安裝,我采用yum安裝
    python 安裝 第三方包
  3. 檢測pip -V 存在與否
    python 安裝 第三方包
  4. pip  --help 檢視幫助參數

    pip install xxx   #線上安裝的

    python 安裝 第三方包
  5. 5

    本地化安裝pip資源

    pip install --cacahe-dir .  shinken*.tar.gz

    dir  後面是本地化檔案的位置

    python 安裝 第三方包

######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(<pip._vendor.urllib3.connection

.VerifiedHTTPSConnection object at 0x048D9B10>, \'Connection to pypi.org timed ou

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(<pip._vendor.urllib3.connection

.VerifiedHTTPSConnection object at 0x048D9B10>, \'Connection to pypi.org timed ou

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>

python 安裝 第三方包