将python 3.8文件转换为.exe [英] Converting a python 3.8 file to .exe

查看:69
本文介绍了将python 3.8文件转换为.exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试了一段时间.我遵循了一个教程,该教程说您应该首先安装 pyinstaller .因此,我安装了它.然后它说您应该在cmd中编写 pyinstaller --onefile -w file_name.py .我也有一个问题(有一个错误).因此,我安装了另一个版本的pyinstaller.我写了同样的东西,但是没有创建.exe文件,只有一个名为" pycache "的新文件夹,其中包含一个新的.pyc文件(我想这是我要转换成的文件的版本.EXE文件).然后我尝试安装cx Frozen,但pip无法安装.

I've been trying to do so for a while. I followed a tutorial which said you should install pyinstaller first. So, I installed it. Then it said you should write pyinstaller --onefile -w file_name.py in cmd. I had an issue with that as well (there was an error). So, I installed another version of pyinstaller. I wrote the same thing, but no .exe file was created, only a new folder named "pycache" with a new .pyc file inside (I suppose it's a version of the file I wanted to turn into .exe). Then I tried installing cx freeze but pip won't install it.

我不知道什么是最好的方法,也许你们中的一个已经尝试这样做了?

I don't know what's the best way, maybe one of you have already tried doing this?

编辑-这是我在cmd中写的内容及其内容:

K:\>pyinstaller --onefile -w K:\geut_project\client_nuovo.py

74 INFO: PyInstaller: 4.0.dev0+9dd34bdfba

74 INFO: Python: 3.8.0

74 INFO: Platform: Windows-10-10.0.17134-SP0

250 INFO: wrote K:\client_nuovo.spec

252 INFO: UPX is not available.

261 INFO: Extending PYTHONPATH with paths

['K:\\geut_project', 'K:\\']

261 INFO: checking Analysis

312 INFO: checking PYZ

364 INFO: checking PKG

380 INFO: Building because K:\build\client_nuovo\client_nuovo.exe.manifest changed

380 INFO: Building PKG (CArchive) PKG-00.pkg

3881 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.

3897 INFO: Bootloader c:\users\user1\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\bootloader\Windows-64bit\runw.exe

3898 INFO: checking EXE

3918 INFO: Rebuilding EXE-00.toc because pkg is more recent

3918 INFO: Building EXE from EXE-00.toc

3929 INFO: Appending archive to EXE K:\dist\client_nuovo.exe

6885 INFO: Building EXE from EXE-00.toc completed successfully.

K:\>

正如我所说,我希望它创建一个可执行文件,但据我所知没有.它只在名为 __ pycache __ 的文件夹中创建了一个名为client_nuovo.cpython-38.pyc的文件(原始文件名为client_nuovo).

As I said I expected it to create an executable file but it didn't (as far as I know). It only created a folder named __ pycache__ and inside a file named client_nuovo.cpython-38.pyc (the original file's name is client_nuovo).

推荐答案

根据此问题,PyInstaller尚不支持python 3.8: https://github.com/pyinstaller/pyinstaller/issues/4311

According to this issue, PyInstaller doesn't support python 3.8 yet: https://github.com/pyinstaller/pyinstaller/issues/4311

这篇关于将python 3.8文件转换为.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆