目录
安装 pyinstaller
问题1:
解决办法: CMD中输入
问题2:
解决办法: CMD中输入
问题3:
将py文件打包成exe中,需要按照如下在CMD中输入
PyInstaller介绍
          PyInstaller是一个Python库,可以将Python代码打包成独立的可执行文件,可以在没有安装Python解释器的机器上运行,也可以在没有源代码的情况下共享和分发自己的应用程序。PyInstaller可以将Python代码转换为可执行文件,支持Windows、Mac OS X和Linux等操作系统。
 使用PyInstaller可以让Python程序变得更加便携、易于分发和部署,同时也可以保护源代码,防止被反编译和修改。PyInstaller使用简单,只需要在命令行中输入命令即可将Python代码转换为可执行文件,还可以通过配置文件进行自定义设置。

安装 pyinstaller
在CMD中输入
pip install  pyinstaller问题1:
The 'enum34' package is an obsolete backport of a standard library package and is incompatible with PyInstaller. Please conda remove enum34 then try again
  
解决办法: CMD中输入
pip uninstall enum34问题2:
The 'typing' package is an obsolete backport of a standard library package and is incompatible with PyInstaller. Please remove this package (located in C:\Users\HuiLong\AppData\Local\Programs\Python\Python39\lib\site-packages) using
     "C:\Users\HuiLong\AppData\Local\Programs\Python\Python39\python.exe" -m pip uninstall typing
then try again.
解决办法: CMD中输入
pip uninstall typing问题3:
将py文件打包成exe中,需要按照如下在CMD中输入
pyinstaller -F xxxx.py例如









![[已解决] 决定系数R2为何为负 from sklearn.metrics import r2_score](https://img-blog.csdnimg.cn/14a86e054d2d4f65bf377e1238b482a1.png)










