this is tricky.

1) -- I can't tell from t he deface README, but *many* python command like
programs can also be. run via the. python executable, e.g.

python -m deface

That is, the actual top level script is a python "Main" function somewhere
that could be called directly. Ideally, this is how a Python command line
tool is set up.

You could look at the build setup (e.g. pyproject.toml) and it might make
it clear.

2) If not -- the problem is that deface, even if fully installed (which it
may not be) in the Installer, that version isn't on the executable PATH.
You may be able to explicitly set the path the executable.

I'd go down the road of (1) -- in any case, you need to figure out. how the
top. level `deface` command gets installed, in order to figure out how to
use it.

Good luck!

-CHB







On Mon, Nov 4, 2024 at 7:37 AM Abh Hom <[email protected]> wrote:

> I'm trying to create a UI for the deface package (
> https://pypi.org/project/deface/) in python using Tkinter as the basic UI
> elements. When I run the exe on my own computer which has all the packages
> installed (deface and ttkbootstrap) the program runs fine.
>
> But whenever I run this same exe on a separate machine that does not have
> deface package manually installed, the program sends me an error saying
> 'deface' is not a recognized command.
>
> For context, the deface package in python is a command line tool, so it
> runs entirely on the shell level rather than on a 'function from a script'
> level. Or at least this is my understanding.
>
> I've tried to manually direct pyinstaller to the deface package using
> --add-data, and --CollectALL, and changing the spec file to make sure the
> 'deface' package is listed there but in all these methods, the same problem
> still occurs. At each point, and with every iteration of the pyinstaller
> exe, the failure point seems to be this line:
>
> command = ["deface", file, "-t", str(current_threshold), "-o",
> outputfilename]
>
> process = subprocess.Popen(command, stdout=subprocess.PIPE,
> stderr=subprocess.PIPE, shell=True)
>
> First, I'm constructing the 'command' with all my required arguments for
> the 'deface' package. Then I'm passing this through to the command line
> using subprocess().
>
> The error is still 'deface' is not recognized as a command, function etc.
> etc.
>
> Is there something that I'm doing wrong? Is this error occurring because
> I'm sending this variable down to the command line using this exe file
> which is an incorrect method?
>
> Thanks to anyone who gives feedback here. My current workaround is having
> to manually install python, deface, and ttkbootstrap beforehand and then my
> program runs just fine but I wanted a nice workaround this just because my
> potential users may not have technological expertise to install python and
> deface package by themselves. I wanted to give a nice 'point and click'
> method for my program and user interface.
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/pyinstaller/47b82f50-6a4a-4783-b594-698970b64863n%40googlegroups.com
> <https://groups.google.com/d/msgid/pyinstaller/47b82f50-6a4a-4783-b594-698970b64863n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxEL67D2YXpqUHXDibyNyD1%2Bq-PrvbKY-vcOOCu8RiQxCFA%40mail.gmail.com.

Reply via email to