Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[How-to] Cannot get program to work #120

Open
brechtBDCK opened this issue Dec 11, 2024 · 4 comments
Open

[How-to] Cannot get program to work #120

brechtBDCK opened this issue Dec 11, 2024 · 4 comments

Comments

@brechtBDCK
Copy link

I am very new to docker and such, but i'm trying to create a windows EXE file from inside my WSL2 system.
My folder looks the following:

image

where data is a folder containing excel files (which main.py needs to create some nice figures)
Dockerfile is

FROM batonogov/pyinstaller-windows:latest

# Copy your project files
COPY . /src

# Set working directory
WORKDIR /src

# Install dependencies if needed
RUN pip install -r requirements.txt

# Build the executable
CMD ["pyinstaller", "--onefile", "--add-data ","data:/data", "--hidden-import", "PIL._tkinter_finder", "main.py"]

which i then run using: docker run --volume "$(pwd):/src/" batonogov/pyinstaller-windows:latest

the error(s)
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
0044:err:vulkan:vulkan_init_once Failed to load libvulkan.so.1
0044:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0044:err:winediag:nodrv_CreateWindow L"The explorer process failed to start."
0044:err:systray:initialize_systray Could not create tray window
00c8:err:winebth:bluez_dbus_init Failed to get system dbus connection: "org.freedesktop.DBus.Error.FileNotFound": "Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory"
00c8:err:ntoskrnl:ZwLoadDriver failed to create driver L"\Registry\Machine\System\CurrentControlSet\Services\winebth": c00000e5

It then continues pip for the packages

pyinstaller: error: the following arguments are required: scriptname

Copy link

🎉 Thank you for your first issue! We will look into it soon.

@batonogov
Copy link
Owner

Hi @brechtBDCK,

Thank you for reaching out and providing detailed information about your setup and issue! It's great to see you experimenting with Docker for building Windows executables.

From the information you've shared, it seems like you're trying to create an EXE file inside a Docker container based on batonogov/pyinstaller-windows. However, I'm not entirely sure how to reproduce the exact issue you're encountering. Could you clarify a few things to help me understand better?

I wrote a simple tkinter application and built it without any problems.

docker run --platform linux/amd64 \
  --volume "$(pwd):/src/" \
  batonogov/pyinstaller-windows:latest \
  "pyinstaller --onefile main.py"

photo_2024-12-11 21 50 41

You can provide additional details to pinpoint the root cause? Happy to assist further!

@brechtBDCK
Copy link
Author

I see from your example code that you are specifying --platform linux/amd64, even though you are running the exe from windows?
The thing is, i want to (from inside my wsl linux) create a windows .exe file. So far i've tried with the --platform windows64 flag, but maybe this is wrong because the exe i get never works when running it from my windows folder system.

@batonogov
Copy link
Owner

I am compiling exe on Mac with Arm processor, so I use --platform linux/amd64 key.

Inside the container we have Linux with Wine and therefore there can be no --platform windows.

In general, if you are compiling exe on windows, you don't need my container. :) You can simply install pyinstaller on your windows and use the command pyinstaller --onefile main.py.

This container is needed if you don't have windows and you need to make a program for windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants