记录一下。
写了个Python代码,一个小脚本,想生成exe能够在win7上面一键运行
于是我就通过命令行输入pip install pyinstaller直接下载包
后来发现pyinstaller 目前并不支持python3.6,打包python3.6程序时
会出现“:IndexError: tuple index out of range”
我还出现了
PyInstaller cannot check for assembly dependencies.
Please install PyWin32 or pywin32-ctypes.
pip install pypiwin32
然后就顺手装了pip install pypiwin32
为了能够在Python3.6下面使用,我进入github找到pyinstaller直接下载包文件。解压文件里找到Pyinstaller文件夹
然后下载文件之后将文件中的Pyinstaller放入site-packages最后一个文件目录就是下载的文件
因为我是anaconda安装的Python,所以是Anaconda下属文件。其实找到Python文件夹下面的site-packages就行,放到里面。
然后cmd命令行进入Pyinstaller文件所在目录,使用python setup.py install命令安装。
然后将待打包的example.py文件放入Pyinstaller文件夹下面,接上一步命令行,输入
python pyinstaller.py -F examp.py
然后在Pyinstaller文件夹会生成example文件夹,里面的dist子文件夹里有example.exe
然后就可以了。不过生成的exe比较大。。。包含了解释器