Building Binaries

It’s weird that the build example ships with an empty platforms string. I remember I was struggling with the same problem when I first tried to build my Panda3D app.

I don’t need to specify the system platform. All this is built by default. This may be an error in some cases where the platform is not specified. In which cases, you need to find out.

I found out what this code outputs:
win32
How can this be?

from setuptools import setup

import sys
print(sys.platform)

setup(
    name="asteroids",
    options = {
        'build_apps': {
            'include_patterns': [
                '**/*.png',
                '**/*.jpg',
                '**/*.egg',
            ],
            'gui_apps': {
                'asteroids': 'main.py',
            },
            'log_filename': '$USER_APPDATA/Asteroids/output.log',
            'log_append': False,
            'plugins': [
                'pandagl',
                'p3openal_audio',
            ],
            'platforms': [
                'win_amd64',
            ]
        }
    }
)

sys.platform will always return win32 on Windows, as far as I know. This is not a way to distinguish between 32 and 64 bit platforms.

Before you start apologizing since you can’t write. I am new to the forum and I have a limited number of problems.
I have been testing and after several attempts I have removed Panda in its 64-bit version to install Panda in its 32-bit version
I have to say this if it compiles with some error both in the 64 bit ‘platforms’ version:
['win_amd64',] as for the 32-bit version win32. Although it shows some error on the screen.
I can run the EXE

So I come to a series of conclusions

1 That the 64-bit installer is not correct.
2 That some configuration is not on my PC Ok.

What information will this code give out in the console?

from direct.showbase.ShowBase import ShowBase
import platform

class Demo(ShowBase):

    def __init__(self):
        ShowBase.__init__(self)
        
        print(platform.architecture())

demo = Demo()
demo.run()

Panda working on its 32-bit version

Known pipe types:
  wglGraphicsPipe
(all display modules loaded.)
('32bit', 'WindowsPE')
  1. there is definitely one thing you need to do, find out the operating system bit.

Open the Windows console and run the command:

set Pro

Press Enter.

Example from my:

PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 158 Stepping 9, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=9e09
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G

Correction: enter - systeminfo

Sorry it was not necessary, I mixed up the command to determine the prossecor.

Enter: systeminfo

Need a line: Type of system

Nombre del sistema operativo:              Microsoft Windows 10 Home
Versión del sistema operativo:             10.0.18362 N/D Compilación 18362
Fabricante del sistema operativo:          Microsoft Corporation
Configuración del sistema operativo:       Estación de trabajo independiente
Tipo de compilación del sistema operativo: Multiprocessor Free
Propiedad de:                              Windows User
Organización registrada:
Id. del producto:                          00325-95800-00000-AAOEM
Fecha de instalación original:             24/08/2019, 4:55:21
Tiempo de arranque del sistema:            06/04/2020, 20:45:53
Fabricante del sistema:                    LENOVO
Modelo el sistema:                         81BF
Tipo de sistema:                           x64-based PC
Procesador(es):                            1 Procesadores instalados.
                                           [01]: Intel64 Family 6 Model 142 Stepping 10 GenuineIntel ~1792 Mhz

And so in order.

  1. Installer for Windows (64-bit)

  2. Replace the content setup.py from this post:

from setuptools import setup

setup(
    name="asteroids",
    options = {
        'build_apps': {
            'include_patterns': [
                '**/*.png',
                '**/*.jpg',
                '**/*.egg',
            ],
            'gui_apps': {
                'asteroids': 'main.py',
            },
            'log_filename': '$USER_APPDATA/Asteroids/output.log',
            'log_append': False,
            'plugins': [
                'pandagl',
                'p3openal_audio',
            ],
            'platforms': [
                'win_amd64',
            ]
        }
    }
)
  1. Open the command window (console)

  2. cd C:\Panda3D-1.10.6-x64\samples\asteroids
    Press enter

  3. C:\Panda3D-1.10.6-x64\python\python.exe setup.py build_apps
    Press enter

  4. If this doesn’t work, you need to create a theme on github.

Some more clarifications:

  • You should be able to build for any platform from any supported host (e.g., make a win_amd64 from 32bit Windows). You will just be restricted on which of the output builds you will be able to run.
  • The warnings (missing modules, could not find dependency) are not errors, and they can be ignored unless you encounter an error when running the build.

I do not know why the 64bit build is not working though. I would recommend removing the log_filename and log_append options and switch gui_apps to console_apps. This way you get easy to find/see console output when debugging why the build is not working.

I couldn’t build a win32 application build using Panda 64x. I think it’s obviously impossible. I admit that I was not quite accurate with the wording.

I was getting exactly the same error.

I had a suspicion that the web script incorrectly determined the system’s bit. But this was not confirmed.

The fact is that here begins the construction of win32 using the SDK 64x.

It is possible to specify the target platform due to the absence of it. As indicated @maxxim It helped him.

It is absolutely, 100% possible to build a 32-bit application using 64-bit Panda, and even the other way around. Nothing from the target platform binaries is executed. No platform detection is being done by Panda. You linked to a post that shows a successful build, with only harmless warnings.

When no platforms key is provided in setup.py, it will always build for ['win_amd64', 'manylinux1_x86_64', 'macosx_10_6_x86_64'], regardless of which platform you are on.

@Inventoraplicaciones I suspect that the problem is that you have more than one installation of Panda3D on your system, so that when egg2bam is executed, it uses the egg2bam belonging to a different Panda3D installation, creating a conflict. I recommend uninstalling all other builds of Panda3D you can find on your system.

You also need to make sure that you are using the right version of python.exe. You can use ppython.exe to force the use of Panda’s copy of Python (assuming you have only one of them).

You can ignore most warnings output by the process. That doesn’t necessarily indicate that there was a failure.

1 Like

Hmm, for me this became possible only after I removed the old Panda3D paths completely from the environment variable path. I also deleted the path to Panda3D-1.10.6-64x. Here’s my verdict: does not need to use the environment variable path in Windows, this only creates problems.

Over the years of using Windows, I’ve taken a simple approach. It is safest to use this type of interpreter call.

C:/Panda3D-1.10.6-64x/python/python.exe main.py

Regarding the failed build, the conclusion was made based on the absence of the build in the folder. It may have been recorded somewhere else.

It did not work create the exe but it did not run

C:\Panda3D-1.10.6-x64\samples\asteroids>C:\Panda3D-1.10.6-x64\python\python.exe setup.py build_apps
running build_apps
Building platforms: win_amd64
Gathering wheels for platform: win_amd64
Looking in indexes: https://pypi.org/simple, https://archive.panda3d.org/simple/opt, https://archive.panda3d.org/thirdparty
Collecting panda3d (from -r C:\Panda3D-1.10.6-x64\samples\asteroids\requirements.txt (line 1))
  Using cached https://buildbot.panda3d.org/downloads/c9f14a1209487c8335dd06bda10c6ac6d8420244/opt/panda3d-1.10.6%2Bopt-cp37-cp37m-win_amd64.whl
  Saved c:\panda3d-1.10.6-x64\samples\asteroids\build\__whl_cache__\win_amd64_cp37m\panda3d-1.10.6+opt-cp37-cp37m-win_amd64.whl
Successfully downloaded panda3d
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Building runtime for platform: win_amd64
There are some missing modules: ['__builtin__', '_posixsubprocess']
warning: build_apps: could not find dependency VERSION.dll (referenced by python37.dll)

warning: build_apps: could not find dependency VCRUNTIME140.dll (referenced by python37.dll)

warning: build_apps: could not find dependency VCRUNTIME140.dll (referenced by deploy-stubw.exe)

warning: build_apps: could not find dependency SETUPAPI.dll (referenced by libpanda.dll)

warning: build_apps: could not find dependency bcrypt.dll (referenced by libcrypto-1_1.dll)

Copying game files for platform: win_amd64
egg2bam failed: [WinError 5] Acceso denegado

C:\Panda3D-1.10.6-x64\samples\asteroids>

Obviously, egg2bam runs from a different version of the SDK.
Try clearing the path environment variable from any mention of the Panda.

Wait, if I’m translating that correctly then it seems to be saying egg2bam was denied access to the files in question. Are they perhaps located somewhere to which access is controlled? Or are their individual file-permissions perhaps allow only limited access?

This may also be due to the lack of administrator rights. This is why I prefer to do everything manually, which eliminates many problems with automation. The more subprocesses are performed in the build, the more likely it is that a non-standard situation will occur.