SyntaxError: (unicode error) ‘utf-8’ codec can’t decode byte 0xe9 in position 0: unexpected end of data (sitecustomize.py, line 7)
It’s getting into a mess because of the é in mélissa in your filenames although it’s hard to tell where. I also have a é in my username and I’ve not seen that error come from pip (although it springs up in plenty of other places).
But it hasn’t stopped there. There’s two ways pip can install a source distribution and it looks like it’s tried both and neither worked. The second error is easier however:
error: invalid command ‘bdist_wheel’
This just mean you haven’t got wheel
installed. Run:
pip install wheel
Then try again. (Maybe pip install -U setuptools
whilst you’re at it to be safe).
I see your Python is installed in a user folder containing an é. That probably explains why you’re seeing more problems than I do. Unless you’re happy to uninstall Python then reinstall it somewhere else, I suggest you create a virtual environment using venv.
python -m venv env
to create a environment in the folder env
.env\Scripts\activate.bat
to enter your environment. Only affects this terminal.pip install pyinstaller other dependencies
pyinstaller
.pip install --upgrade pip
needs to be python -m pip install --upgrade pip
on Windows. Otherwise the little pip.exe
has to overwrite itself whilst it’s still running which Windows won’t allow. Using python -m pip
however doesn’t use the pip.exe
file.
Traceback (most recent call last):
File "C:\Users\Mélissa\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Mélissa\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "E:\test virtual env\testing\Scripts\auto-py-to-exe.exe\__main__.py", line 7, in <module>
File "e:\test virtual env\testing\lib\site-packages\auto_py_to_exe\__main__.py", line 99, in run
start_ui(logging_level)
I forgot that a venv still uses the original standard library packages so will still have the é problem there. In which case, venv is probably not enough. Uninstalling and reinstalling Python might be your only option. Bet even that might not do it because it could use paths from the TMP
or USERPROFILE
environment variables. I guess you could try running as admin. Or creating a new login.
Ideally the traceback would be more helpful. You could try adding some print statements in e:\test virtual env\testing\lib\site-packages\gevent\threadpool.py to find out exactly which filename it's not happy with.
Ughh that can be anything. You’re building in windowed mode which makes it very hard to understand problems. Remove any -w
, --windowed
or --no-console
flags from your pyinstaller
command then try again. Run the program from terminal. It’ll still break but the error will be easier to see.
Brénainn
Are you using subprocess
anywhere in your code (possibly indirectly through another library)? That’s the usual cause for console mode to work but windowed to break. You need explicitly set all 3 stdin
, stdout
and stderr
to either subprocess.DEVNULL
or subprocess.PIPE
.
Subprocess is part of the standard library. As for indirectly using it - If you put:
import sys
sys.modules["subprocess"] = None
at the top of your code then run it normally in Python, do you get an error saying ModuleNotFoundError: import of subprocess halted; None in sys.modules
? If not, are you able to share your code?
Found it! It’s the --debug all
which breaks it. It can’t be used with --noconsole
. This is fixed in pyinstaller 5.0 but we haven’t released it yet. So you can either installer the development version of pyinstaller from github:
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
Or get rid of debug mode:
pyinstaller --noconfirm --onedir --windowed "game main.py"
from tkinter import *
import pyttsx3
root = Tk()
root.title("Voices test for Mélissa A.I. - Other Files")
root.geometry("500x450")
def talk():
engine = pyttsx3.init()
engine.setProperty("rate", 200)
voices = engine.getProperty("voices")
engine.setProperty("voice", voices[2].id)
engine.say(my_entry.get())
engine.runAndWait()
my_entry.delete(0, END)
my_entry = Entry(root, font=("Helvetica", 20))
my_entry.pack(pady=20)
my_button = Button(root, text="Speak", command=talk)
my_button.pack(pady=20)
root.mainloop()
--
You received this message because you are subscribed to a topic in the Google Groups "PyInstaller" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyinstaller/IJXFdvIs--0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/e84cdaba-d5bd-4a9e-95e1-1409418006b3n%40googlegroups.com.
The voice thing is just a ModuleNotFoundError
which you always fix with a --hiddenimport
. In this case use --hiddenimport=pyttsx3.drivers.sapi5
(or put pyttsx3.drivers.sapi5
in the Advanced > —hiddenimport box in autopytoexe).
The voice thing is just a
ModuleNotFoundError
which you always fix with a--hiddenimport
. In this case use--hiddenimport=pyttsx3.drivers.sapi5
(or putpyttsx3.drivers.sapi5
in the Advanced > —hiddenimport box in autopytoexe).
--
You received this message because you are subscribed to a topic in the Google Groups "PyInstaller" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyinstaller/IJXFdvIs--0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/8e02b951-8192-4823-90f8-1bdb2ee44834n%40googlegroups.com.
So if i understand well, every time i use a library whit a voice thing/use… pyttsx3 or other, i have to find the xxxx.drivers.sapi5 and put in the hidden import…
No, it’s specific to pyttsx3
. Very specifically, this line of code uses importlib
instead of just import
which breaks PyInstaller and requires special --hiddenimport
. And it’s different on Linux of macOS. I’ll write a hook for it. It seems to be quite popular.
They have a site who i can find all these error message and how to deal whit it?
Not really. I’m supposed to be writing it. I haven’t got very far.
Because now i using auto-py-to-exe but maybe for some program it will be more accurate to use Pyinstaller instead.
auto-py-toexe is just PyInstaller with buttons. It shouldn’t matter which you use. I prefer the command line because it’s quicker and I don’t like using the mouse but that’s just me…
--
You received this message because you are subscribed to a topic in the Google Groups "PyInstaller" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyinstaller/IJXFdvIs--0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/9b98f7ae-8136-434c-baec-d9b592a855f7n%40googlegroups.com.
I’ve just fixed pyttsx3
compatibility in #101. In a couple of weeks you will be able to pip install "pyinstaller-hooks-contrib>=2021.2"
but until then you can use the Github version: pip install -U https://github.com/pyinstaller/pyinstaller-hooks-contrib/archive/refs/heads/master.zip
. Add the --clean
option the first time you run it if you’re not using auto-py-to-exe
. It should then work on all platforms without using --hiddenimport
.
I’ve just fixed
pyttsx3
compatibility in #101. In a couple of weeks you will be able topip install "pyinstaller-hooks-contrib>=2021.2"
but until then you can use the Github version:pip install -U https://github.com/pyinstaller/pyinstaller-hooks-contrib/archive/refs/heads/master.zip
. Add the--clean
option the first time you run it if you’re not usingauto-py-to-exe
. It should then work on all platforms without using--hiddenimport
.
--
You received this message because you are subscribed to a topic in the Google Groups "PyInstaller" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyinstaller/IJXFdvIs--0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/dca16f59-8177-4f4d-897d-00bca50f48f6n%40googlegroups.com.