开发中需要对python编写的程序进行打包,生成exe文件以便未安装python以及库依赖的用户进行使用。由于开发环境中的库文件复杂冗余,打包时导致文件很大,遂考虑在虚拟环境中进行打包。

解决方案:conda + pyinstaller

过程:

  conda create --name work_space python=3.6

  conda activate

  conda install packages

  conda install pyinstaller == pip install pyinstaller

  pyinstaller -Fw C:\User\Documents\pyinstall\ocr.py  # 打包完成  

  conda deactivate  #关闭虚拟环境

  conda delete -n work_space --all  #删除一个已有环境

  conda env list

  conda list  #查看环境列表以及包列表

  

相关文章:

  • 2021-05-05
  • 2021-06-04
  • 2021-06-07
  • 2021-11-03
  • 2021-11-23
  • 2021-12-29
  • 2022-01-02
  • 2021-06-24
猜你喜欢
  • 2022-12-23
  • 2021-04-17
  • 2021-08-29
  • 2021-09-10
  • 2021-05-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案