如何安装并使用Python3.6版本的PyInstaller?

2026-05-28 22:041阅读0评论SEO基础
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计543个文字,预计阅读时间需要3分钟。

如何安装并使用Python3.6版本的PyInstaller?

1. 安装PyInstaller和Anaconda,然后安装Python。 - 由于Anaconda自带了许多库,可以节省很多安装时间。

2.使用国外库安装PyInstaller时,可能会遇到以下错误:

- ERROR: Could not fetch URL 'https://pypi.org/simple/PyInstaller/' (from https://pypi.org/simple) - Could not resolve host 'pypi.org'. - ERROR: Could not fetch URL 'https://pypi.org/simple/PyInstaller/' (from https://pypi.org/simple) - Could not resolve host 'pypi.org'.

一、安装pyinstaller

先安装anacode,再去安装python。会有很多自带的lib库,可以省去很多麻烦。

1、用国外库安装

pip install pyinstalller

由于国外网络的限制,经常会报以下错误:

ERROR: Could not find a version that satisfies the requirement pyinstalller (from versions: none)
ERROR: No matching distribution found for pyinstalller

可以通过翻墙解决这一问题

2、用国内库安装

这里使用的是豆瓣的镜像进行安装

pip3 install pyinstaller -i pypi.douban.com/simple/ --trusted-host pypi.douban.com Looking in indexes: pypi.douban.com/simple/

如果出现以下问题:

这里主要是是‘enum'参数问题:

如何安装并使用Python3.6版本的PyInstaller?

AttributeError: module 'enum' has no attribute 'IntFlag'

通过百度得知,是由于python版本的升级,导致了‘enum'出现兼容性问题,只要卸载‘enum'库就好了。

pip uninstall enum34

输出:

Found existing installation: enum34 1.1.6
Uninstalling enum34-1.1.6:
Would remove:
c:\programdata\anaconda3\lib\site-packages\enum34-1.1.6.dist-info\*
c:\programdata\anaconda3\lib\site-packages\enum\*
Proceed (y/n)?

输入:y
输出:

Successfully uninstalled enum34-1.1.6

卸载成功,重新输入安装指令就可以安装成功

二、使用pyinstaller

1、pyinstaller常用选项
2、生成exe

pyinstaller -Fw main.py ui.py

最终生成main.exe

总结

到此这篇关于Python3.6 pyinstaller安装和使用的文章就介绍到这了,更多相关Python3.6 pyinstaller 内容请搜索易盾网络以前的文章或继续浏览下面的相关文章希望大家以后多多支持易盾网络!

本文共计543个文字,预计阅读时间需要3分钟。

如何安装并使用Python3.6版本的PyInstaller?

1. 安装PyInstaller和Anaconda,然后安装Python。 - 由于Anaconda自带了许多库,可以节省很多安装时间。

2.使用国外库安装PyInstaller时,可能会遇到以下错误:

- ERROR: Could not fetch URL 'https://pypi.org/simple/PyInstaller/' (from https://pypi.org/simple) - Could not resolve host 'pypi.org'. - ERROR: Could not fetch URL 'https://pypi.org/simple/PyInstaller/' (from https://pypi.org/simple) - Could not resolve host 'pypi.org'.

一、安装pyinstaller

先安装anacode,再去安装python。会有很多自带的lib库,可以省去很多麻烦。

1、用国外库安装

pip install pyinstalller

由于国外网络的限制,经常会报以下错误:

ERROR: Could not find a version that satisfies the requirement pyinstalller (from versions: none)
ERROR: No matching distribution found for pyinstalller

可以通过翻墙解决这一问题

2、用国内库安装

这里使用的是豆瓣的镜像进行安装

pip3 install pyinstaller -i pypi.douban.com/simple/ --trusted-host pypi.douban.com Looking in indexes: pypi.douban.com/simple/

如果出现以下问题:

这里主要是是‘enum'参数问题:

如何安装并使用Python3.6版本的PyInstaller?

AttributeError: module 'enum' has no attribute 'IntFlag'

通过百度得知,是由于python版本的升级,导致了‘enum'出现兼容性问题,只要卸载‘enum'库就好了。

pip uninstall enum34

输出:

Found existing installation: enum34 1.1.6
Uninstalling enum34-1.1.6:
Would remove:
c:\programdata\anaconda3\lib\site-packages\enum34-1.1.6.dist-info\*
c:\programdata\anaconda3\lib\site-packages\enum\*
Proceed (y/n)?

输入:y
输出:

Successfully uninstalled enum34-1.1.6

卸载成功,重新输入安装指令就可以安装成功

二、使用pyinstaller

1、pyinstaller常用选项
2、生成exe

pyinstaller -Fw main.py ui.py

最终生成main.exe

总结

到此这篇关于Python3.6 pyinstaller安装和使用的文章就介绍到这了,更多相关Python3.6 pyinstaller 内容请搜索易盾网络以前的文章或继续浏览下面的相关文章希望大家以后多多支持易盾网络!