[GH-ISSUE #395] Exe file shows "No module named 'ctypes' " #320

Closed
opened 2026-02-26 12:21:12 +03:00 by kerem · 2 comments
Owner

Originally created by @kcvinker on GitHub (May 4, 2023).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/395

Hi all,
I wrote a gui library with ctypes and created a small program. Everything works fine. But after I created exe file with auto-py-to-exe, when I ran the exe file, it showed a message box. It says that No module named 'ctypes'
See this image.
image

Originally created by @kcvinker on GitHub (May 4, 2023). Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/395 Hi all, I wrote a gui library with ctypes and created a small program. Everything works fine. But after I created exe file with auto-py-to-exe, when I ran the exe file, it showed a message box. It says that No module named 'ctypes' See this image. ![image](https://user-images.githubusercontent.com/8840907/236352187-4ff45091-9fb6-4868-9472-b2c399b8c0a5.png)
kerem closed this issue 2026-02-26 12:21:12 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (May 4, 2023):

👋 Hi, just a reminder that if you haven't read the help post yet, give it a read to see if your issue is covered in it and make sure to follow the debugging section.

Also please note, as stated in the README, if your issue is only associated with your application and not auto-py-to-exe itself, please do not create an issue in this repository - instead, comment on the help post, video or create a new discussion.

<!-- gh-comment-id:1535531220 --> @github-actions[bot] commented on GitHub (May 4, 2023): 👋 Hi, just a reminder that if you haven't read [the help post](https://nitratine.net/blog/post/issues-when-using-auto-py-to-exe/) yet, give it a read to see if your issue is covered in it and make sure to follow [the debugging section](https://nitratine.net/blog/post/issues-when-using-auto-py-to-exe/#debugging). Also please note, as stated in the README, if your issue is only associated with your application and not auto-py-to-exe itself, please do not create an issue in this repository - instead, comment on the help [post](https://nitratine.net/blog/post/issues-when-using-auto-py-to-exe/), [video](https://youtu.be/OZSZHmWSOeM) or create a [new discussion](https://github.com/brentvollebregt/auto-py-to-exe/discussions).
Author
Owner

@kcvinker commented on GitHub (May 4, 2023):

Oh I see. Okay. Anyhow, I found the problem.

sys.path.append(r"C:\Users\kcvin\OneDrive\Programming\Python\PyForms")

This is how I connect my gui library to my script.
I just commented it and copy pasted the script to "PyForms" directory. Then I compiled it an exe and it worked.

<!-- gh-comment-id:1535535109 --> @kcvinker commented on GitHub (May 4, 2023): Oh I see. Okay. Anyhow, I found the problem. ```python sys.path.append(r"C:\Users\kcvin\OneDrive\Programming\Python\PyForms") ``` This is how I connect my gui library to my script. I just commented it and copy pasted the script to "PyForms" directory. Then I compiled it an exe and it worked.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/auto-py-to-exe#320
No description provided.