Description
Description:
When pip installing a library that adds console scripts on Python 3.10+ on Windows x86, I get the following message:
WARNING: The scripts <> and <> are installed in 'C:\Users\runneradmin\AppData\Roaming\Python\Python3XX-32\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
See this action run at this specific line for example: https://github.com/mhammond/pywin32/actions/runs/12664473637/job/35292676675?pr=2408#step:5:3578
This doesn't see to affect x64 self-hosted runners or Python 3.9 and under.
I'm not 100% certain where the issue lies, but I'm assuming that this path not being added to PATH lies with setup-python
I couldn't find anything in Python 3.10's changelog indicating that this is an intended change within official Python installers themselves (no idea if this would happen with a local install)
Action version:
v5
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Tools version:
3.10, x86
3.11, x86
3.12, x86
3.13, x86
Repro steps:
Run the actions of this commit (permalink): https://github.com/Avasam/pywin32/blob/61e4698/.github/workflows/main.yml
Expected behavior:
C:\Users\runneradmin\AppData\Roaming\Python\Python310-32\Scripts to be present on path, no warning and scripts are accessible
Actual behavior:
Installing collected packages: pywin32
WARNING: The scripts pywin32_postinstall.exe and pywin32_testall.exe are installed in 'C:\Users\runneradmin\AppData\Roaming\Python\Python310-32\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Activity
v-aparnajyothi-y commentedon Jan 9, 2025
Hello @Avasam, Thank you for creating this issue and we will look into it :)
Avasam commentedon Jan 19, 2025
I am temporarily working around this issue with the following step:
v-aparnajyothi-y commentedon Jan 23, 2025
Hello @Avasam, Thank you for your patience as we worked through this issue. Here’s an explanation of why the warning appears during the installation of PyInstaller, but not for pywin32:
When the PyInstaller package is installed with the --user flag, the following warning appears:
WARNING: The scripts pyi-archive_viewer.exe, pyi-bindepend.exe, pyi-grab_version.exe, pyi-makespec.exe, pyi-set_version.exe, and pyinstaller.exe are installed in C:\Users\runneradmin\AppData\Roaming\Python\Python310-32\Scripts, which is not on PATH.
Consider adding this directory to PATH, or if you prefer to suppress this warning, use --no-warn-script-location.
This happens because the directory where these scripts are installed is not included in the system's PATH environment variable. As a result, the system cannot automatically locate these executables, prompting pip to issue the warning.
This behavior is expected when installing Python packages with the --user flag as per the official Python documentation on --user flag.
The user-specific installation directory is typically located in ~/.local/ (on Linux/macOS) or %APPDATA%\Python (on Windows). For further details on where this directory is and how it works, you can refer to the Python documentation here.
We can address the warning in one of two ways:
For guidance on modifying the PATH variable, see the Python documentation for User Installation Path.
pip install --no-warn-script-location
In our basic workflow, we did not encounter this warning because the script locations were likely already included in the correct PATH, or it could be due to differences in the environment (e.g., virtual environments or the default system setup). However, the warning appeared in your case when using the --user flag due to the specific installation method and the location of the scripts.
I’ve also attached screenshots for reference to illustrate this.
I hope this clarifies the situation. Please let us know if you need any further assistance!
Avasam commentedon Jan 23, 2025
Thanks for the response @aparnajyothi-y . I don't need to, or intend to, suppress the pip warning as it is merely a symptom and a helpful message that helped me find my issue.
The core issue I have is not being able to run installed Python scripts on the CI for Python 3.10+ on x86 architecture specifically. (at least not without a workaround as I have shared above)
I would ask for
setup-pythonto ensure that the...\Python\Python3XX-32\Scriptsfolder is added to path during installation and setup.I can see that https://docs.python.org/3/library/sysconfig.html#nt-user does not mention the
-32suffix. If you think that is out of spec and thatsetup-pythonshould not support it, then let's find who is responsible for setting that as the scripts path and raise an issue there (stdlib? pip? setuptools?).Do note that I verified, by printing the result of
sysconfig.get_path('scripts', f'{os.name}_user')in the CI, that this issue doesn't seem to happen on Python 3.9 and below because-32isn't appended to the path then.https://github.com/mhammond/pywin32/actions/runs/12849740577/job/35828625751?pr=2408#step:5:14
PS.: The link you shared https://docs.python.org/3/install/index.html#custom-installation is not valid (404 Not Found)
Avasam commentedon Apr 28, 2025
Hello again! I see there's an active PR, thanks for looking into it.
Just wanted to mention that this also happens for
arm64on all current Python version (so 3.11 to 3.13, since no prebuilt arm Python distribution is available before 3.11)v-aparnajyothi-y commentedon Jul 8, 2025
Hi @Avasam, The issue reported here has been addressed in PR #1122, which has been merged into the main branch. Accordingly, we are closing this issue.
Please feel free to reach us in case of any questions / clarifications needed.
Thanks again for your patience and feedback!
Remove actions/setup-python#1005 workaround
Remove actions/setup-python#1005 workaround + Retarget Win SDK for Py…