[SOLVED] Python PATH problem since the WAPT 2.6 update

Share your tips or issues concerning the WAPT Console or WAPT Agent here
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
erems
Messages: 46
Registration: Apr 25, 2023 - 3:52 p.m.

May 5, 2025 - 3:05 PM

Hello,

since the WAPT update from 2.5 to 2.6, several users have complained about their Python scripts.

It seems that the Python script embedded in the WAPT agent is in the system PATH and is therefore now called by default regardless of the session. Other Python installations usually use user environment variables.

For now, I'm having them add their Python path to the system variables above the WAPT path, but
1- this isn't very clean
, and 2- it might impact the WAPT agent.

Is there a better solution?

Thank you for your help.
Best regards.
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

May 5, 2025 - 3:43 PM

Hello Erems,

the corresponding xkcd: https://xkcd.com/1987/
erems wrote: May 5, 2025 - 3:05 PM ...
it seems that the Python embedded in the WAPT agent is in the system PATH and therefore it is now called by default regardless of the session. Other Python installations usually use user environment variables.

For now, I'm having them add their Python path to the system variables above the WAPT path, but
1- this isn't very clean
In the user PATH, does it point to Python installations located in %APPDATA% or in %PROGRAMFILES%?

2 - This may have an impact on the WAPT agent
No, that's not a problem. We did a lot of work cleaning up the Python search paths at wapt startup. By the way, the python.exe from python.org is rather unpredictable in its discovery of system DLLs, and we had to rewrite it to improve its behavior. In the wapt installation, the python.exe binary is actually the same as wapt-get.exe.
Is there a better solution?
We've been wanting to correct this behavior for a while so that there is only wapt-get.exe in the %PATH% (basically, create a subdirectory /bin/ with just wapt-get.exe in it).

Sincerely,

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
erems
Messages: 46
Registration: Apr 25, 2023 - 3:52 p.m.

May 5, 2025 - 3:55 PM

We've been wanting to correct this behavior for a while so that there is only wapt-get.exe in the %PATH% (basically, create a subdirectory /bin/ with just wapt-get.exe in it).
It's certain that with that there would be no more possible confusion.

Otherwise, most of our local Python installations are in %APPDATA%.

Best regards.
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

May 5, 2025 - 4:08 PM

Yes, generally speaking, typing "python" in a terminal without the fullpath is really not deterministic.

For example, my path:

Code: Select all

PATH=C:\Program Files\Python313\Scripts\;C:\Program Files\Python38\Scripts\;C:\Program Files\Python39\Scripts\
So if I launch Python in my terminal, I won't necessarily get the Python version I'm expecting. Therefore, I never just launch "python"

Furthermore, if you type "python3" in the terminal on a Windows 10 system, it can also open the Microsoft Store...

So I would say that even if we correct the fact of not having wapt python in the path, the correct method is to type the fullpath of python. :D
erems
Messages: 46
Registration: Apr 25, 2023 - 3:52 p.m.

May 6, 2025 - 3:22 PM

Thank you, I'll pass the message on to our team.

Best regards.
Locked