使用pip安装python模块和包


点击进入幕布视图浏览 https://mubu.com/doc/a8VGCUfqqw

五、使用pip安装python第三方库。

  • pip的常用命令
  • 方式一:在线安装
  • 方式二:离线安装
  • 方法三:用Python代码自动安装
    import os.path as op
    import os
    
    def pipInstall():
        libs=['Scikit-Learn','PIL','Requests','Sympy']
        for i in libs:
            try:
                os.system('pip install '+i+' -i https://pypi.tuna.tsinghua.edu.cn/simple/')
                print('Successfully installed '+i)
            except:
                print('Unsuccessfully installed '+i)
    pipInstall()

     

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM