python添加/删除 库以及程序打包

版权声明:归所有菜鸟所有 https://blog.csdn.net/weixin_41752475/article/details/89289743

添加
千万最好不要直接pip install ***
这样做如果电脑有多个解释器,你不知你用的哪一个,导致你这个并不是所有都能调用
如果进行了这种操作需要 pip uninstall ***
https://pypi.org/project/pygame/#files
进https://www.lfd.uci.edu/~gohlke/pythonlibs/下载对应的.whl文件
win+r进入运行,打开cmd
也可以进入Anaconda prompt进行
也可以直接在pycharm的Termianl执行操作

//如果要升级pip(只安装包这段不需要),必须保证python在路经path里
C:\Users\sartreck>python -m pip install --upgrade pip
//加库
C:\Users\sartreck>d:     //假设下载的库在E盘的下载 文件夹里
D:\>cd /d E:\下载    //也可以直接转到下载文件夹,不需要经过D盘
E:\下载>python -m pip  install --user xxxxx.whl        //安装
Processing E:\下载\xxxx.whl
Installing collected packages: xxxx
  The script xxxx.exe is installed in 'C:\Users\ck\AppData\Roaming\Python\Python36\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed xxx
这里最好把提示的这段C:\Users\ck\AppData\Roaming\Python\Python36\Scripts加入环境变量Path里

直接在pycharm打开Terminal进行打包,首先转到ico与py文件的文件夹(让在一个文件夹里)

F:\pycharm program\lec09>pyinstaller -F -w -i 12.ico lec_1.0.py

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_41752475/article/details/89289743