r0x0r / pywebview

Build GUI for your Python program with JavaScript, HTML, and CSS
https://pywebview.flowrl.com
BSD 3-Clause "New" or "Revised" License
4.77k stars 555 forks source link

Error building pythonet #1493

Closed itsmeadarsh2008 closed 1 month ago

itsmeadarsh2008 commented 1 month ago

Specification

Description

Error in installation

(reflex-desktop) PS D:\dev\experiments\reflex-desktop> uv pip install pywebview
Resolved 6 packages in 4.89s
Building pythonnet==2.5.2
error: Failed to prepare distributions
  Caused by: Failed to fetch wheel: pythonnet==2.5.2
  Caused by: Build backend failed to build wheel through `build_wheel()` with exit code: 1
--- stdout:
running bdist_wheel
running build
running build_ext
Checking for updates from https://api.nuget.org/v3/index.json [https://api.nuget.org/v3/index.json].
  CACHE https://api.nuget.org/v3/registration5-gz-semver2/nuget.commandline/index.json
  CACHE https://api.nuget.org/v3/registration5-gz-semver2/nuget.commandline/page/1.0.11220.26/4.4.2.json
  CACHE https://api.nuget.org/v3/registration5-gz-semver2/nuget.commandline/page/4.4.3/6.7.0.json
  CACHE https://api.nuget.org/v3/registration5-gz-semver2/nuget.commandline/page/6.7.1/6.11.1.json
Currently running NuGet.exe 6.11.1.
NuGet.exe is up to date.
Update successful.
MSBuild auto-detection: using msbuild version '17.11.2.32701' from 'C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin'.
WARNING: Error reading msbuild project information, ensure that your input solution or project file is valid. NETCore and UAP projects will be skipped, only packages.config files will be restored.
All packages listed in packages.config are already installed.
  GET https://api.nuget.org/v3/vulnerabilities/index.json
  OK https://api.nuget.org/v3/vulnerabilities/index.json 375ms
  GET https://api.nuget.org/v3-vulnerabilities/2024.10.10.05.27.24/vulnerability.base.json
  GET https://api.nuget.org/v3-vulnerabilities/2024.10.10.05.27.24/2024.10.10.05.27.24/vulnerability.update.json
  OK https://api.nuget.org/v3-vulnerabilities/2024.10.10.05.27.24/vulnerability.base.json 48ms
  OK https://api.nuget.org/v3-vulnerabilities/2024.10.10.05.27.24/2024.10.10.05.27.24/vulnerability.update.json 215ms
--- stderr:
<string>:468: SyntaxWarning: invalid escape sequence '\*'
<string>:533: SyntaxWarning: invalid escape sequence '\*'
Cannot find the specified version of msbuild: '14'
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Microsoft.CSharp.CurrentVersion.targets(317,5): error MSB4019: The imported project "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn\Microsoft.CSharp.Core.targets" is correct, and that the file exists on disk. [C:\Users\adarsh\AppData\Local\uv\cache\built-wheels-v3\pypi\pythonnet\2.5.2\xq0FdVBAmRKt3M2XfmiVk\pythonnet-2.5.2.tar.gz\src\runtime\Python.Runtime.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Microsoft.CSharp.CurrentVersion.targets(317,5): error MSB4019: The imported project "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn\Microsoft.CSharp.Core.targets" is correct, and that the file exists on disk. [C:\Users\adarsh\AppData\Local\uv\cache\built-wheels-v3\pypi\pythonnet\2.5.2\xq0FdVBAmRKt3M2XfmiVk\pythonnet-2.5.2.tar.gz\src\testing\Python.Test.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Microsoft.CSharp.CurrentVersion.targets(317,5): error MSB4019: The imported project "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn\Microsoft.CSharp.Core.targets" is correct, and that the file exists on disk. [C:\Users\adarsh\AppData\Local\uv\cache\built-wheels-v3\pypi\pythonnet\2.5.2\xq0FdVBAmRKt3M2XfmiVk\pythonnet-2.5.2.tar.gz\src\embed_tests\Python.EmbeddingTest.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Microsoft.CSharp.CurrentVersion.targets(317,5): error MSB4019: The imported project "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn\Microsoft.CSharp.Core.targets" is correct, and that the file exists on disk. [C:\Users\adarsh\AppData\Local\uv\cache\built-wheels-v3\pypi\pythonnet\2.5.2\xq0FdVBAmRKt3M2XfmiVk\pythonnet-2.5.2.tar.gz\src\console\Console.csproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Microsoft.CSharp.CurrentVersion.targets(317,5): error MSB4019: The imported project "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn\Microsoft.CSharp.Core.targets" is correct, and that the file exists on disk. [C:\Users\adarsh\AppData\Local\uv\cache\built-wheels-v3\pypi\pythonnet\2.5.2\xq0FdVBAmRKt3M2XfmiVk\pythonnet-2.5.2.tar.gz\src\clrmodule\clrmodule.csproj]

Traceback (most recent call last):
  File "C:\Users\adarsh\AppData\Local\uv\cache\built-wheels-v3\pypi\pythonnet\2.5.2\xq0FdVBAmRKt3M2XfmiVk\pythonnet-2.5.2.tar.gz\tools\geninterop\geninterop.py", line 29, in <module>
    from pycparser import c_ast, c_parser
ModuleNotFoundError: No module named 'pycparser'
Traceback (most recent call last):
  File "<string>", line 11, in <module>
    wheel_filename = backend.build_wheel("\\\\?\\C:\\Users\\adarsh\\AppData\\Local\\uv\\cache\\built-wheels-v3\\pypi\\pythonnet\\2.5.2\\xq0FdVBAmRKt3M2XfmiVk\\.tmpnnTc7E", {}, None)
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\build_meta.py", line 421, in build_wheel
    return self._build_with_temp_dir(
           ~~~~~~~~~~~~~~~~~~~~~~~~~^
        ['bdist_wheel'],
        ^^^^^^^^^^^^^^^^
    ...<3 lines>...
        self._arbitrary_args(config_settings),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\build_meta.py", line 403, in _build_with_temp_dir
    self.run_setup()
    ~~~~~~~~~~~~~~^^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\build_meta.py", line 503, in run_setup
    super().run_setup(setup_script=setup_script)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\build_meta.py", line 318, in run_setup
    exec(code, locals())
    ~~~~^^^^^^^^^^^^^^^^
  File "<string>", line 630, in <module>
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\__init__.py", line 117, in setup
    return distutils.core.setup(**attrs)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\_distutils\core.py", line 183, in setup
    return run_commands(dist)
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\_distutils\core.py", line 199, in run_commands
    dist.run_commands()
    ~~~~~~~~~~~~~~~~~^^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\_distutils\dist.py", line 954, in run_commands
    self.run_command(cmd)
    ~~~~~~~~~~~~~~~~^^^^^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\dist.py", line 950, in run_command
    super().run_command(command)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command
    cmd_obj.run()
    ~~~~~~~~~~~^^
  File "<string>", line 612, in run
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\_vendor\wheel\bdist_wheel.py", line 368, in run
    self.run_command("build")
    ~~~~~~~~~~~~~~~~^^^^^^^^^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
    self.distribution.run_command(command)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\dist.py", line 950, in run_command
    super().run_command(command)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command
    cmd_obj.run()
    ~~~~~~~~~~~^^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\_distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
    self.distribution.run_command(command)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\dist.py", line 950, in run_command
    super().run_command(command)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command
    cmd_obj.run()
    ~~~~~~~~~~~^^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 359, in run
    self.build_extensions()
    ~~~~~~~~~~~~~~~~~~~~~^^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 476, in build_extensions
    self._build_extensions_serial()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "C:\Users\adarsh\AppData\Local\uv\cache\builds-v0\.tmpbF2Unp\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 502, in _build_extensions_serial
    self.build_extension(ext)
    ~~~~~~~~~~~~~~~~~~~~^^^^^
  File "<string>", line 302, in build_extension
  File "C:\Users\adarsh\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 419, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['C:\\Users\\adarsh\\AppData\\Local\\uv\\cache\\builds-v0\\.tmpbF2Unp\\Scripts\\python.exe', 'tools\\geninterop\\geninterop.py', 'src\\runtime\\interop313.cs']' returned non-zero exit status 1.
---
r0x0r commented 1 month ago

I am sorry I cannot help you with pythonnet issues. Have you tried installing the latest version though?

itsmeadarsh2008 commented 1 month ago

yes, the library was working like a charm before I upgraded my os to windows 11 from windows 10