Open Matt8198 opened 1 year ago
Thanks for the report. I can't say I've seen this behaviour myself; Can I ask what (if any) .NET libraries you have installed on your system? I didn't think it was necessary to install a .NET runtime for Python.net to work... but maybe it is required?
i have this problem on win10 with py311
@coolcoder613eb That doesn't address the most recent question that I asked - What (if any) .NET libraries do you have installed?
it worked before i upgraded to py311, so i do not think it is relevant. when i upgraded, i symlinked my 3.10 site-packages to my 3.11 ones to save disk space.
On Mon, 9 Jan 2023 at 17:46, Russell Keith-Magee @.***> wrote:
@coolcoder613eb https://github.com/coolcoder613eb That doesn't address the most recent question that I asked - What (if any) .NET libraries do you have installed?
— Reply to this email directly, view it on GitHub https://github.com/beeware/briefcase/issues/1017#issuecomment-1375172659, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW5VQRBN7JVY6ZJZWZZO2E3WROX5RANCNFSM6AAAAAATI6M5EE . You are receiving this because you were mentioned.Message ID: @.***>
@coolcoder613eb Symlinking site packages across Python versions is not an approach that is likely to yield reliable results. It's entirely possible that you've created this problem on your own.
If you can reproduce the problem with a vanilla installation, then please provide the briefcase crash log, as well as the detail I've requested about .NET.
[Moved to #1060]
@CarlosHGL, can you take a look at #922 and see if one of the workarounds help you finish the build? I don't see anything obviously wrong but I can see you are using Python from the Windows Store.
@rmartin16: This looks like a different problem, so I've moved it to a separate issue (#1060).
@jlij No - because we've been waiting on someone to provide the detail that has been requested. What (if any) .NET libraries do you have installed on your system when you observe this problem?
This issue seems to stem from using a 32bit version of Python to run briefcase run
. This conflicts somehow with the stub app running the embedded Python (which is 64bit) and loading the CLR through Python.NET.
Python will include its bitness when running the interpreter:
32 bit
❯ python
Python 3.11.3 (tags/v3.11.3:f3909b8, Apr 4 2023, 23:34:50) [MSC v.1934 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
64 bit
❯ python
Python 3.11.2 (tags/v3.11.2:878ead1, Feb 7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
After a little more investigation, the underlying problem is the the 32bit Windows wheel for cffi
is being installed when using 32bit Python.
[helloworld] Updating requirements...
>>> Running Command:
>>> 'C:\Users\user\github\beeware\briefcase\venv-3.11-win32-briefcase\Scripts\python.exe' -u -m pip install --upgrade --no-user '--target=C:\Users\user\github\beeware\briefcase\tmp\helloworld\build\helloworld\windows\visualstudio\x64\Release\app_packages' 'toga-winforms~=0.3.1'
>>> Working Directory:
>>> C:\Users\user\github\beeware\briefcase\tmp\helloworld
>>> Environment Overrides:
>>> PYTHONPATH=C:\Users\user\github\beeware\briefcase\tmp\helloworld\build\helloworld\windows\visualstudio\x64\Release\platform-site
Collecting toga-winforms~=0.3.1
Using cached toga_winforms-0.3.1-py3-none-any.whl (328 kB)
Collecting pythonnet>=3.0.0 (from toga-winforms~=0.3.1)
Using cached pythonnet-3.0.1-py3-none-any.whl (284 kB)
Collecting toga-core==0.3.1 (from toga-winforms~=0.3.1)
Using cached toga_core-0.3.1-py3-none-any.whl (499 kB)
Collecting travertino>=0.1.3 (from toga-core==0.3.1->toga-winforms~=0.3.1)
Using cached travertino-0.2.0-py3-none-any.whl (16 kB)
Collecting clr-loader<0.3.0,>=0.2.2 (from pythonnet>=3.0.0->toga-winforms~=0.3.1)
Using cached clr_loader-0.2.5-py3-none-any.whl (51 kB)
Collecting cffi>=1.13 (from clr-loader<0.3.0,>=0.2.2->pythonnet>=3.0.0->toga-winforms~=0.3.1)
Using cached cffi-1.15.1-cp311-cp311-win32.whl (170 kB)
Collecting pycparser (from cffi>=1.13->clr-loader<0.3.0,>=0.2.2->pythonnet>=3.0.0->toga-winforms~=0.3.1)
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Installing collected packages: travertino, pycparser, toga-core, cffi, clr-loader, pythonnet, toga-winforms
Successfully installed cffi-1.15.1 clr-loader-0.2.5 pycparser-2.21 pythonnet-3.0.1 toga-core-0.3.1 toga-winforms-0.3.1 travertino-0.2.0
>>> Return code: 0
Installing app requirements... done
Since the stub app is compiled for 64 bits, we need the 64 bit version of cffi
to be installed so it can find and load the .NET Framework at runtime.
Pip supports overriding how it requests wheels such that wheels for arbitrary platforms can be installed. Something like this in WindowsCreateCommand
would achieve that here:
def _extra_pip_args(self, app: AppConfig):
return ["--platform", "win_amd64", "--only-binary", ":all:"]
>>> Running Command:
>>> 'C:\Users\user\github\beeware\briefcase\venv-3.11-win32-briefcase\Scripts\python.exe' -u -m pip install --upgrade --no-user '--target=C:\Users\user\github\beeware\briefcase\tmp\helloworld\build\helloworld\windows\visualstudio\x64\Release\app_packages' --platform win_amd64 --only-binary :all: 'toga-winforms~=0.3.1'
>>> Working Directory:
>>> C:\Users\user\github\beeware\briefcase\tmp\helloworld
>>> Environment Overrides:
>>> PYTHONPATH=C:\Users\user\github\beeware\briefcase\tmp\helloworld\build\helloworld\windows\visualstudio\x64\Release\platform-site
Collecting toga-winforms~=0.3.1
Using cached toga_winforms-0.3.1-py3-none-any.whl (328 kB)
Collecting pythonnet>=3.0.0 (from toga-winforms~=0.3.1)
Using cached pythonnet-3.0.1-py3-none-any.whl (284 kB)
Collecting toga-core==0.3.1 (from toga-winforms~=0.3.1)
Using cached toga_core-0.3.1-py3-none-any.whl (499 kB)
Collecting travertino>=0.1.3 (from toga-core==0.3.1->toga-winforms~=0.3.1)
Using cached travertino-0.2.0-py3-none-any.whl (16 kB)
Collecting clr-loader<0.3.0,>=0.2.2 (from pythonnet>=3.0.0->toga-winforms~=0.3.1)
Using cached clr_loader-0.2.5-py3-none-any.whl (51 kB)
Collecting cffi>=1.13 (from clr-loader<0.3.0,>=0.2.2->pythonnet>=3.0.0->toga-winforms~=0.3.1)
Using cached cffi-1.15.1-cp311-cp311-win_amd64.whl (179 kB)
Collecting pycparser (from cffi>=1.13->clr-loader<0.3.0,>=0.2.2->pythonnet>=3.0.0->toga-winforms~=0.3.1)
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Installing collected packages: travertino, pycparser, toga-core, cffi, clr-loader, pythonnet, toga-winforms
Successfully installed cffi-1.15.1 clr-loader-0.2.5 pycparser-2.21 pythonnet-3.0.1 toga-core-0.3.1 toga-winforms-0.3.1 travertino-0.2.0
>>> Return code: 0
Installing app requirements... done
Additionally, pip insists on a setting for binary or not:
[helloworld] Updating requirements...
ERROR: When restricting platform and interpreter constraints using --python-version, --platform, --abi, or --implementation, either --no-deps must be set, or --only-binary=:all: must be set and --no-binary must not be set (or must be set to :none:).
Installing app requirements...
So - this is all good diagnosis, but... how much do we care? How big is the market for 32-bit Windows these days? If these metrics are to be believed, the size of the 32 bit Windows market is 0 within the margin of error. Given that we can't unit test 32 bit Windows (AFAIK), wouldn't our safe option be to just raise an error if the user is on a 32 bit system and move on?
This isn't about 32bit Windows, though. This is about 32bit Python.
Sure - but... same story. Is there any good reason someone is using 32-bit Python on a 64-bit system, other than "it exists and I didn't know there was an alternative, I just downloaded the first installer I saw on the list"? Finding market share numbers for 32-bit Python is a little harder to come by, but I can't really think of a reason anyone would be actively using 32-bit Windows on a 32 bit system, other than legacy.
We're definitely on the same page about support for 32-bit Windows.
As for 32-bit Python, I doubt there's any broad and/or reasonable rationale to run it nowadays....maybe someone needs to use a package that's only 32-bit compatible....but I don't think that's a good rationale to impact our decisions here.
Mostly, I would expect people running 32-bit Python to be doing so largely arbitrarily. It wasn't until Python 3.9, that python.org pushed 64-bit as the default download.
Ultimately, I'm not necessarily advocating for supporting 32-bit Python. And since I've already been evaluating how to limit Briefcase to only running commands on supported architectures, this check would add another layer...albeit only really for Windows. This also would ideally allow Windows on arm64 to still work...personally, I think Windows on ARM may see a real uptake in the next few years (or longer) but we'll see...
And then there's 32-bit ARM...but I'll spare us here :)
At the end of the day, I'm definitely not interested in a bunch of complications to support these niche platform combinations. But I think I'd also like to see some of them work if it doesn't take too much work. (Speaking of which, my proposed solution in the diagnosis would complicate arm64 support...)
If I do anything here, it'll likely be a part of the larger architecture verification I've been looking at.
Somewhat of a proxy metric for 32-bit Python on Windows.
Describe the bug
Hi,
Following your tutorial, it failed when I used the “briefcase.exe run” command. The create and build commands didn't fail. I can also use the briefcase dev command with no problems.
briefcase run log
``` (venv_teamcolo) PS C:\Users\matth\Documents\Teamcolo\teamcolo> briefcase.exe run --log [teamcolo] Starting app... =========================================================================== Log started: 2022-12-25 12:41:36Z PreInitializing Python runtime... PythonHome: C:\Users\matth\Documents\Teamcolo\teamcolo\windows\app\Teamcolo\src PYTHONPATH: - C:\Users\matth\Documents\Teamcolo\teamcolo\windows\app\Teamcolo\src\python39.zip - C:\Users\matth\Documents\Teamcolo\teamcolo\windows\app\Teamcolo\src - C:\Users\matth\Documents\Teamcolo\teamcolo\windows\app\Teamcolo\src\app_packages - C:\Users\matth\Documents\Teamcolo\teamcolo\windows\app\Teamcolo\src\app Configure argc/argv... Initializing Python runtime... Running app module: teamcolo --------------------------------------------------------------------------- Traceback (most recent call last): File "\app_packages\pythonnet\__init__.py", line 73, in _create_runtime_from_spec return clr_loader.get_netfx(**params) File "\app_packages\clr_loader\__init__.py", line 146, in get_netfx from .netfx import NetFx File "\app_packages\clr_loader\netfx.py", line 5, inAfter some research, I tried to install the cffi package (after uninstalling it) in the environment, but also outside. It didn't solve the problem.
I don't know if some people have already had this issue.
If you need more information, please ask me.
Steps to reproduce
Expected behavior
No error returned.
Screenshots
No response
Environment
Logs
full briefcase run log
``` Date/Time: 2022-12-25 12:41:39 Command line: C:\Users\matth\Documents\Teamcolo\venv_teamcolo\Scripts\briefcase run --log OS Release: Windows 10 OS Version: 10.0.22621 Architecture: AMD64 Platform: Windows-10-10.0.22621 Python exe: C:\Users\matth\Documents\Teamcolo\venv_teamcolo\Scripts\python.exe Python version: 3.9.8 (tags/v3.9.8:bb3fdcf, Nov 5 2021, 20:33:01) [MSC v.1929 32 bit (Intel)] Virtual env: True Conda env: False Briefcase: 0.3.11 Target platform: windows Target format: app Environment Variables: ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\matth\AppData\Roaming CHROME_CRASHPAD_PIPE_NAME=\\.\pipe\crashpad_36524_SHCGTZXMAMZCACZV CLION=D:\CLion 2019.2.4\bin; COLORTERM=truecolor COMMONPROGRAMFILES=C:\Program Files (x86)\Common Files COMMONPROGRAMFILES(X86)=C:\Program Files (x86)\Common Files COMMONPROGRAMW6432=C:\Program Files\Common Files COMPUTERNAME=PC-MATTHIAS COMSPEC=C:\WINDOWS\system32\cmd.exe CONFIGSETROOT=C:\WINDOWS\ConfigSetRoot DISQUE=D:\ DRIVERDATA=C:\Windows\System32\Drivers\DriverData FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer FPS_BROWSER_USER_PROFILE_STRING=Default GIT_ASKPASS=******************** HOMEDRIVE=C: HOMEPATH=\Users\matth LANG=fr_FR.UTF-8 LOCALAPPDATA=C:\Users\matth\AppData\Local LOGONSERVER=\\PC-MATTHIAS NUMBER_OF_PROCESSORS=12 ONEDRIVE=C:\Users\matth\OneDrive ONEDRIVECONSUMER=C:\Users\matth\OneDrive ORIGINAL_XDG_CURRENT_DESKTOP=undefined OS=Windows_NT PATH=C:\Users\matth\Documents\Teamcolo\venv_teamcolo\Scripts;C:\Program Files (x86)\Python39-32\Scripts\;C:\Program Files (x86)\Python39-32\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;D:\Git\cmd;D:\Mingw-w64\mingw32\bin\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\Matlab\runtime\win64;D:\Matlab\bin;D:\Matlab\polyspace\bin;C:\Program Files\Polyspace\R2019b\runtime\win64;C:\Program Files\Polyspace\R2019b\bin;C:\Program Files\Polyspace\R2019b\polyspace\bin;C:\Program Files\nodejs\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Git\cmd;C;C:\Program Files\usbipd-win\;C:\Program Files\PuTTY\;C:\Program Files\CMake\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Docker\Docker\resources\bin;C:\Users\matth\scoop\shims;C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin;C:\Users\matth\AppData\Local\Programs\Python\Python37-32\Scripts\;C:\Users\matth\AppData\Local\Programs\Python\Python37-32\;C:\Users\matth\AppData\Local\Microsoft\WindowsApps;D:\Microsoft VS Code\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;D:\CLion 2019.2.4\bin;C:\Users\matth\AppData\Roaming\npm;C:\Users\matth\AppData\Local\GitHubDesktop\bin;C:\Program Files\Azure Data Studio\bin;C:\Users\matth\.dotnet\tools;C:\Users\matth\AppData\Local\Microsoft\WindowsApps;C:\Users\matth\.dotnet\tools PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW;.CPL PICO_SDK_PATH=C:\Users\matth\OneDrive\Documents\Pico\pico-sdk PROCESSOR_ARCHITECTURE=x86 PROCESSOR_ARCHITEW6432=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 158 Stepping 10, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=9e0a PROGRAMDATA=C:\ProgramData PROGRAMFILES=C:\Program Files (x86) PROGRAMFILES(X86)=C:\Program Files (x86) PROGRAMW6432=C:\Program Files PSMODULEPATH=C:\Users\matth\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\PowerShell\Modules\ PUBLIC=C:\Users\Public SESSIONNAME=Console SYSTEMDRIVE=C: SYSTEMROOT=C:\WINDOWS TEMP=C:\Users\matth\AppData\Local\Temp TERM_PROGRAM=vscode TERM_PROGRAM_VERSION=1.73.1 TMP=C:\Users\matth\AppData\Local\Temp USERDOMAIN=PC-MATTHIAS USERDOMAIN_ROAMINGPROFILE=PC-MATTHIAS USERNAME=matth USERPROFILE=C:\Users\matth VBOX_MSI_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\ VIRTUAL_ENV=C:\Users\matth\Documents\Teamcolo\venv_teamcolo VSCODE_GIT_ASKPASS_EXTRA_ARGS=******************** VSCODE_GIT_ASKPASS_MAIN=******************** VSCODE_GIT_ASKPASS_NODE=******************** VSCODE_GIT_IPC_HANDLE=\\.\pipe\vscode-git-3e2ea1f4c3-sock WINDIR=C:\WINDOWS ZES_ENABLE_SYSMAN=1 _OLD_VIRTUAL_PATH=C:\Program Files (x86)\Python39-32\Scripts\;C:\Program Files (x86)\Python39-32\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;D:\Git\cmd;D:\Mingw-w64\mingw32\bin\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\Matlab\runtime\win64;D:\Matlab\bin;D:\Matlab\polyspace\bin;C:\Program Files\Polyspace\R2019b\runtime\win64;C:\Program Files\Polyspace\R2019b\bin;C:\Program Files\Polyspace\R2019b\polyspace\bin;C:\Program Files\nodejs\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Git\cmd;C;C:\Program Files\usbipd-win\;C:\Program Files\PuTTY\;C:\Program Files\CMake\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Docker\Docker\resources\bin;C:\Users\matth\scoop\shims;C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin;C:\Users\matth\AppData\Local\Programs\Python\Python37-32\Scripts\;C:\Users\matth\AppData\Local\Programs\Python\Python37-32\;C:\Users\matth\AppData\Local\Microsoft\WindowsApps;D:\Microsoft VS Code\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;D:\CLion 2019.2.4\bin;C:\Users\matth\AppData\Roaming\npm;C:\Users\matth\AppData\Local\GitHubDesktop\bin;C:\Program Files\Azure Data Studio\bin;C:\Users\matth\.dotnet\tools;C:\Users\matth\AppData\Local\Microsoft\WindowsApps;C:\Users\matth\.dotnet\tools Briefcase Log: [12:41:36] __init__.py:82 [teamcolo] Starting app... __init__.py:82 =========================================================================== __init__.py:85 subprocess.py:516 >>> Running Command: subprocess.py:517 >>> 'C:\Users\matth\Documents\Teamcolo\teamcolo\windows\app\Teamcolo\src\Teamcolo.exe' subprocess.py:518 >>> Working Directory: subprocess.py:525 >>> C:\Users\matth subprocess.py:526 [12:41:39] >>> Return code: 1 subprocess.py:553 __main__.py:27 Unable to start app teamcolo. __main__.py:28 ╭─────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────╮ │ C:\Users\matth\Documents\Teamcolo\venv_teamcolo\lib\site-packages\briefcase\platforms\windows\__init__.py:86 in run_app │ │ │ │ 83 │ │ try: │ │ 84 │ │ │ # Start streaming logs for the app. │ │ 85 │ │ │ self.logger.info("=" * 75) │ │ ❱ 86 │ │ │ self.tools.subprocess.run( │ │ 87 │ │ │ │ [os.fsdecode(self.binary_path(app))], │ │ 88 │ │ │ │ cwd=self.tools.home_path, │ │ 89 │ │ │ │ check=True, │ │ │ │ ╭─────────────────────────────────────── locals ───────────────────────────────────────╮ │ │ │ app =Additional context
No response
Workaround
The issue occurs when running 32-bit Python. Install and use Briefcase with 64-bit Python. Full details.