py 各版本下载链接:Index of /ftp/python/
python3.7.9 embed (或称为 release版本) 版下载链接:Index of /ftp/python/3.7.9/
pip 下载链接:Installation - pip documentation v22.2.2 (pypa.io)
在pip下载网页中,查找 "get-pip.py" 的下载链接,右键另存为即可下载该文件
下载 get-pip.py 后,在python embed目录中执行cmd命令,输入命令“python get-pip.py”并敲击回车运行命令,安装完成后,文件夹中会增加Lib和Scripts两个文件夹
记事本打开python37._pth,去除import site的注释,最终修改如下:
python37.zip. # Uncomment to run site.main() automaticallyimport site运行cmd,目录切换至python-3.7.3rc1-embed-win32,输入python.exe .\Scripts\pip3.exe list,结果如下:
xxxxxxxxxxD:\software\python-3.7.3rc1-embed-win32>python.exe .\Scripts\pip3.exe listPackage Version---------- -------pip 19.2.1pywin32 224pywinauto 0.6.7setuptools 41.0.1six 1.12.0wheel 0.33.4以安装django为例,输入python.exe .\Scripts\pip3.exe install django==1.10.1
xxxxxxxxxxD:\software\python-3.7.3rc1-embed-win32>python.exe .\Scripts\pip3.exe install django==1.10.1xxxxxxxxxxD:\software\python-3.7.3rc1-embed-win32>pythonPython 3.7.3rc1 (tags/v3.7.3rc1:69785b2127, Mar 12 2019, 21:42:06) [MSC v.1916 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.>>>