windows下python虚拟环境强制重新安装pip并安装paramiko
环境:
OS:Windows 11
python:3.6.8
1.切换到虚拟环境目录:
cd C:\Users\huangxueliang\PycharmProjects\cmdbtest\venv
2.执行如下命令
Scripts\activate
3.强制重新安装
python -m pip install -U --force-reinstall pip
4.查看版本
(venv) C:\Users\huangxueliang\PycharmProjects\cmdbtest\venv>pip -V
pip 21.3.1 from C:\Users\huangxueliang\PycharmProjects\cmdbtest\venv\lib\site-packages\pip (python 3.6)
5.安装paramiko
(venv) C:\Users\huangxueliang\PycharmProjects\cmdbtest\venv>pip install paramiko Collecting paramiko Using cached paramiko-3.5.0-py3-none-any.whl (227 kB) Collecting bcrypt>=3.2 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001511B1CD710>, 'Connection to files.pythonhosted.org timed out. (connect timeout=15)')': /packages/46/81/d8c22cd7e5e1c6a7d48e41a1d1d46c92f17dae70a54d9814f746e6027dec/bcrypt-4.0.1-cp36-abi3-win_amd64.whl Downloading bcrypt-4.0.1-cp36-abi3-win_amd64.whl (152 kB) |████████████████████████████████| 152 kB 8.9 kB/s Collecting pynacl>=1.5 Downloading PyNaCl-1.5.0-cp36-abi3-win_amd64.whl (212 kB) |████████████████████████████████| 212 kB 75 kB/s Collecting cryptography>=3.3 Downloading cryptography-40.0.2-cp36-abi3-win_amd64.whl (2.6 MB) |████████████████████████████████| 2.6 MB 261 kB/s Requirement already satisfied: cffi>=1.12 in c:\users\huangxueliang\pycharmprojects\cmdbtest\venv\lib\site-packages (from cryptography>=3.3->paramiko) (1.15.1) Requirement already satisfied: pycparser in c:\users\huangxueliang\pycharmprojects\cmdbtest\venv\lib\site-packages (from cffi>=1.12->cryptography>=3.3->paramiko) (2.21) Installing collected packages: pynacl, cryptography, bcrypt, paramiko Successfully installed bcrypt-4.0.1 cryptography-40.0.2 paramiko-3.5.0 pynacl-1.5.0