快速批量安装Python库--os.system

话不多说,直接上代码

#BatchInstall.py
import os
libs = {"numpy","matplotlib","pillow","sklearn","requests","beautifulsoup4","wheel","networkx","sympy","django","flask","werobot","pyqt5","pandas","pyopengl","pypdf2","docopt"}
try:
    for lib in libs:
        os.system("pip install " + lib)
    print("Successful")
except:
    print("Failed Somehow")

这样,就直接可以安装将近20个Python库了,当然你也可以直接下载Anacoda,其中包含了800多个库,使用起来十分的方便.

你可能感兴趣的:(快速批量安装Python库--os.system)