Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Life is a garment we continuously alter, but which never seems to fit." -- David McCord


devel / comp.lang.python / Re: Making a Python program into an executable file

SubjectAuthor
o Re: Making a Python program into an executable fileMats Wichmann

1
Re: Making a Python program into an executable file

<mailman.75.1649701481.20749.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17783&group=comp.lang.python#17783

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: mat...@wichmann.us (Mats Wichmann)
Newsgroups: comp.lang.python
Subject: Re: Making a Python program into an executable file
Date: Mon, 11 Apr 2022 12:19:24 -0600
Lines: 27
Message-ID: <mailman.75.1649701481.20749.python-list@python.org>
References: <323387714.394907.1649693621628.ref@mail.yahoo.com>
<323387714.394907.1649693621628@mail.yahoo.com>
<bebd81af-58d7-f707-6a2c-47e0b9b84547@wichmann.us>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de ywF3F0KZfKMYOWlY3q2tRQJenhm4ralnssqM3duLgF7A==
Return-Path: <mats@wichmann.us>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="1024-bit key; unprotected key"
header.d=pobox.com header.i=@pobox.com header.b=BPeeC7a9;
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.076
X-Spam-Evidence: '*H*': 0.85; '*S*': 0.00; 'subject:into': 0.07;
'approaches': 0.09; 'attempts': 0.09; 'installer': 0.09;
'subject:Python': 0.12; 'that.': 0.15; '"add': 0.16; 'beeware':
0.16; 'exe': 0.16; 'executable': 0.16; 'option.': 0.16;
'received:64.147': 0.16; 'rerun': 0.16; 'right.': 0.16; 'sounds':
0.16; 'subject:program': 0.16; 'wrote:': 0.16; 'python': 0.16;
'larger': 0.17; 'says': 0.17; 'to:addr:python-list': 0.20;
'option': 0.20; 'subject:file': 0.22; 'version': 0.23; '(and':
0.25; 'python,': 0.25; 'depends': 0.25; 'tried': 0.26; 'do?':
0.26; 'project.': 0.27; 'environment': 0.29; 'header:User-
Agent:1': 0.30; 'approach': 0.31; 'modify': 0.31; "doesn't": 0.32;
'happening': 0.32; 'python-list': 0.32; 'but': 0.32; 'there':
0.33; 'path': 0.33; 'windows': 0.34; 'header:In-Reply-To:1': 0.34;
'trying': 0.35; 'close': 0.35; 'files': 0.36; 'using': 0.37;
"it's": 0.37; 'received:192.168': 0.37; 'this,': 0.39;
'mentioned': 0.39; 'program.': 0.40; 'want': 0.40; 'best': 0.61;
'url-ip:142.250.179/24': 0.61; "there's": 0.61; 'dear': 0.62;
'apps': 0.62; 'come': 0.62; 'url-ip:142.250.179.174/32': 0.63;
'copy': 0.63; 'once': 0.63; 'upgrade': 0.64; 'your': 0.64; 'came':
0.65; 'look': 0.65; 'received:64': 0.67; 'that,': 0.67; 'latter':
0.69; 'little': 0.73; 'features': 0.75; 'clicking': 0.76;
'selecting': 0.76; 'advise': 0.78; 'brian': 0.81; 'click': 0.83;
'tricky': 0.84; 'headed': 0.91; 'url:build': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=message-id
:date:mime-version:subject:to:references:from:in-reply-to
:content-type:content-transfer-encoding; s=sasl; bh=hRCHXIcdtJjJ
YMWAG2J1UTaIXEVMHXKwjuAGzFt+TLw=; b=BPeeC7a9yB458Vxtler8URuosEzU
1lW+CPQ0J53VeGQ+PKLAddinrJxHZNkfQvVvq609roCQJc7K95c9zp+zHJTc0LOI
M5n4TGzUh5kjJeY96srxmU3u8dk9mmYtqVnRhTwV6rUGlS3R0WuWGluYkDNkCisy
AIpdav0M6+PmF3c=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=wichmann.us;
h=message-id:date:mime-version:subject:to:references:from:in-reply-to:content-type:content-transfer-encoding;
s=2018-07.pbsmtp; bh=hRCHXIcdtJjJYMWAG2J1UTaIXEVMHXKwjuAGzFt+TLw=;
b=tonMSbrqg1d+WOPLbp+ga5jpioeksirIxgz+xHLIhpbaQOYO3PB702iahO9K21FoQs9qBiHfjFMh9RVCD4swfL5xNqdz4NBorkyG4/l0vV5cvMuu+o+Hk22jB0xsGJufRz0nxtg/LWDXPzkfNZrezo0ZyQN1FWUunJvn1qvEcE4=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Content-Language: en-US
In-Reply-To: <323387714.394907.1649693621628@mail.yahoo.com>
X-Pobox-Relay-ID: EB574B4C-B9C3-11EC-8EF5-CB998F0A682E-81526775!pb-smtp2.pobox.com
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <bebd81af-58d7-f707-6a2c-47e0b9b84547@wichmann.us>
X-Mailman-Original-References: <323387714.394907.1649693621628.ref@mail.yahoo.com>
<323387714.394907.1649693621628@mail.yahoo.com>
 by: Mats Wichmann - Mon, 11 Apr 2022 18:19 UTC

On 4/11/22 10:13, Brian Wagstaff via Python-list wrote:
> Dear Python team,
> I am trying to find out how to make my Python programs into executable files (.exe, I presume) using Pyinstaller. I searched on line for how to do this (the document I came across is headed Data to Fish), and it seemed that Step 1 was to download the most recent version of Python and click the Add Python to Path option. I tried to do this, but was given the option to Upgrade Python, and once I did this the Add Python to Path option seemed not to be available. Can you advise me what to do?
> Best wishes,
> Brian

Presuming this is Windows because it sounds like it (hint: it's useful
to say), you can rerun the installer from the Apps & Features applet by
clicking on Python and then selecting Modify (the option actually says
"Add Python to environment variables").

How to make an "executable" depends on whether you require to include a
copy of Python with that, or not. There are a larger number of
approaches for the latter than the former. zipapps come close for the
latter, if you get your entry point set up right; there's some logic
described there for building an exe as well, but it's a little tricky to
get right. There's a project called Shiv (search pypi.org to find this
one) that attempts to simplify that.

An approach that doesn't get mentioned often (and with which I have no
experience):

https://bazel.build/docs/windows#python

You might also want to look into BeeWare if you want to make a
self-contained app your of your program. Nice work happening in that
project.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor