mirror of
https://github.com/brentvollebregt/auto-py-to-exe.git
synced 2026-04-26 04:05:49 +03:00
[GH-ISSUE #227] ModuleNotFoundError: No module named 'rich' #206
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @EbenenBonobo on GitHub (Jan 5, 2022).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/227
Hello, im trying to create a .exe from a very simple .py, with only "rich" as external dependancy, but Im getting a ModuleNotFoundError in the compiled exe (but not when executing the .py)
example:
In the console it outputs the following error:
Im on Python 3.10.0 and am working in a specially created .venv.
pip freeze creates the following requirements.txt
my current pyinstaller command looks like this:
The
--cleanflag is necessary because otherwise windows declares the exe as malicious...The Output of auto-py-to-exe looks like that:
the flag
--hidden-import "rich"doesn't seem to change the .exe (same size).without rich it works just fine.
@EbenenBonobo commented on GitHub (Jan 6, 2022):
on a different machine with python 3.9 and auto-py-to-exe installed as module in a venv with the project it works without problems, so i just close this. But no idea what i did wrong on the first machine.
@brentvollebregt commented on GitHub (Jan 6, 2022):
There is a good chance you were running auto-py-to-exe with a Python installation that did not have
richinstalled - most likely the venv you were using (by the looks of it).I give some tips on this in my post here if you're curious on how to figure out what went wrong.
@EbenenBonobo commented on GitHub (Jan 6, 2022):
i probably misunderstood the installation instructions, but now everythings works. I now installed auto-py-to-exe in the venv, where I am developing in. Do i always have to install and execute auto-py-to-exe in the same venv that i am developing my .py in? I first thought i could install auto-py-to-exe in an own venv and then when pointing it to a .py file it would only look at the import instructions to determine which packages are needed. But that probably wouldnt work since you could not know about used versions or naming conflicts with local libraries and so on, right?
@brentvollebregt commented on GitHub (Jan 7, 2022):
In the background, PyInstaller needs to be able to find your dependent library. Python installations don't know about each other thus PyInstaller can't see libraries in other Python installations.
@EbenenBonobo commented on GitHub (Jan 7, 2022):
ah, got it! thanks for the explanation!