一般来说都会使用到虚拟环境,比如我这里的虚拟环境的目录E:soft
ypro
,此时就可以这样子导出来
E:soft
yproenvScripts>pip freeze > req.txt
就这样就ok了。当然可能会报错,比如:Fatal error in launcher: Unable to create process using '"C:Userswork.DESKTOP-8L2MJ8VEnvsenvScriptspython.exe" "E:soft
yproenvScriptspip.exe" freeze': ???????????
莫名其妙的错误,最后升级了一下pip工具,命令是python -m pip install --upgrade pip
,这样就好了