0

I've seen many options online, but none of them seem to support Python 3.8. Is there any way to convert a python project to a .exe anymore? If so, how can I do that?

EDIT: I've tried PyInstaller multiple times, both before it was recommended here and afterwards, but I keep getting huge error messages that I don't know how to make sense of.

2
  • 1
    Does this answer your question? Converting a python 3.8 file to .exe Commented Oct 12, 2020 at 0:00
  • I would suggest adding in what you tried and what errors you received. I can spin up a Windows VM and see what I can do myself and what method works for 3.8. Commented Oct 12, 2020 at 0:09

1 Answer 1

1

Use pyinstaller.

Example: pyinstaller yourfile.py -F --onefile

This will turn your code into a .exe file on Windows.

To install PyInstaller, you simply use pip, thus pip install PyInstaller or pip3 install PyInstaller.

You can also make sure you have the latest development version of pyinstaller: pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

Sign up to request clarification or add additional context in comments.

9 Comments

I tried this, and all it did was give me a whole bunch of errors. ``` File "c:\python38\lib\site-packages\urllib3\connectionpool.py", line 3, in <module> import logging File "c:\python38\lib\logging_init_.py", line 26, in <module> import sys, os, time, io, re, traceback, warnings, weakref, collections.abc File "c:\python38\lib\re.py", line 145, in <module> class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag' pre-safe-import-module hook failed, needs fixing. ```
@TMayer The essence of stack overflow is delving into resolving those errors at that level, not at the high level "solve this for me" level, it is about "I tried x and it resulted in y, when I wanted it to result in z" then go from there. I would suggest rewording the question and add in what you tried.
@TMayer looks like you can try pip install enum or similar as a pre-req. This also looks like it might be some BS related to PyCharm or other IDE setting paths and screwing up versions.
@TMayer also may be worth trying the dev build of pyinstaller that should work with 3.8: pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz based on convo here: github.com/pyinstaller/pyinstaller/issues/…
Thanks for your help. I'll try what you suggested.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.