简体   繁体   English

如何将文件.py转换为.exe,从Anaconda Navigator获取Python? (我应该在哪个命令提示符下编写安装代码?)

[英]How to convert file .py to .exe, having Python from Anaconda Navigator? (in which command prompt should I write installation codes?)

I created a Python script (format .py) that works. 我创建了一个有效的Python脚本(格式.py)。 I would like to convert this file to .exe, to use it in a computer without having Python installed. 我想将此文件转换为.exe,以便在没有安装Python的情况下在计算机中使用它。

How can I do? 我能怎么做? I have Python from Anaconda3. 我有来自Anaconda3的Python。

What can I do? 我能做什么? Thank you! 谢谢!

I followed some instruction found here on Stackoverflow. 我按照Stackoverflow上的一些说明进行了操作。 .I modify the Path in the 'Environment variables' in the windows settings, edited to the Anaconda folder. .I修改Windows设置中“环境变量”中的路径,编辑到Anaconda文件夹。 .I managed to install pip in conda prompt (I guess). 我设法在conda提示符下安装pip(我猜)。

Still, nothing is working. 但是,没有任何工作。 I don't know how to proceed and in general how to do things properly. 我不知道如何进行,一般如何正确地做事。

I personaly use pyinstaller, its available from pip. 我个人使用pyinstaller,它可以从pip获得。
But it will not really compile, it will just bundle. 但它不会真正编译,它只会捆绑。
The difference is compiling means translating to real machine code while bundling is creating a big exe file with all your libs and your python interpreter. 不同之处在于编译意味着转换为真实的机器代码,而捆绑正在创建一个包含所有lib和python解释器的大型exe文件。

Even if pyinstaller create bigger file and is slower than cython (at execution), I prefer it because it work all the time without work (except lunching it). 即使pyinstaller创建更大的文件并且比cython(执行时)慢,我更喜欢它,因为它一直工作而没有工作(除了午餐)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM