Windows Pip module uses pip from salt instead of local installation
@twangboy is already working on this.
Since Aug 27, 2026.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description of Issue
In the documentation for salt.modules.pip here, it states that:
Specifying the cwd and bin_env options ensures you're modifying the salt environment. If these are omitted, it will default to the local installation of python. If python is not installed locally it will fail saying it couldn't find pip.
However, the opposite is happening for me. If I do not specify bin_env, then it will use the version of python/pip bundled with salt instead of the local installation.
Setup
Master running on a linux server VM, minion running on a windows VM.
Steps to Reproduce Issue
Install python onto the windows VM, for all users (includes updating the system path), at C:\Python311-64.
Run from the master node:
[salt]$ sudo salt 'test-winvm-1' cmd.run 'where python'
test-winvm-1:
C:\Python311-64\python.exe
[salt]$ sudo salt 'test-winvm-1' cmd.run 'where pip'
test-winvm-1:
C:\Python311-64\Scripts\pip.exe
[salt]$ sudo salt 'test-winvm-1' cmd.run 'pip list'
test-winvm-1:
Package Version
---------- -------
pip 24.0
setuptools 65.5.0
[salt]$ sudo salt 'test-winvm-1' pip.list bin_env='C:\Python311-64\Scripts\pip.exe'
test-winvm-1:
----------
pip:
24.0
setuptools:
65.5.0
So far, so good.
Unfortunately, this should match the last output, but does not:
[salt]$ sudo salt 'test-winvm-1' pip.list
test-winvm-1:
----------
CherryPy:
18.6.1
GitPython:
3.1.37
Jinja2:
3.1.2
<snip>
pip:
22.3.1
<snip>
salt:
3006.5
<snip>
zipp:
3.12.0
Versions Report
Master node:
[salt]$ salt --versions-report
Salt Version:
Salt: 3007.0
Python Version:
Python: 3.10.13 (main, Feb 19 2024, 03:31:20) [GCC 11.2.0]
Dependency Versions:
cffi: 1.16.0
cherrypy: unknown
dateutil: 2.8.2
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 3.1.3
libgit2: Not Installed
looseversion: 1.3.0
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.7
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 23.1
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.19.1
pygit2: Not Installed
python-gnupg: 0.5.2
PyYAML: 6.0.1
PyZMQ: 25.1.2
relenv: 0.15.1
smmap: Not Installed
timelib: 0.3.0
Tornado: 6.3.3
ZMQ: 4.3.4
Salt Package Information:
Package Type: onedir
System Versions:
dist: oracle 8.9
locale: utf-8
machine: x86_64
release: 5.15.0-204.147.6.3.el8uek.x86_64
system: Linux
version: Oracle Linux Server 8.9
Minion:
[salt]$ sudo salt 'test-winvm-1' test.versions_report
test-winvm-1:
Salt Version:
Salt: 3006.5
Python Version:
Python: 3.10.13 (heads/main:5600dd9, Nov 15 2023, 04:42:06) [MSC v.1937 64 bit (AMD64)]
Dependency Versions:
cffi: 1.14.6
cherrypy: 18.6.1
dateutil: 2.8.1
docker-py: Not Installed
gitdb: 4.0.7
gitpython: 3.1.37
Jinja2: 3.1.2
libgit2: Not Installed
looseversion: 1.0.2
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.2
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 22.0
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.10.1
pygit2: Not Installed
python-gnupg: 0.4.8
PyYAML: 6.0.1
PyZMQ: 25.0.2
relenv: 0.14.2
smmap: 4.0.0
timelib: 0.2.4
Tornado: 4.5.3
ZMQ: 4.3.4
System Versions:
dist:
locale: cp1252
machine: AMD64
release: 2019Server
system: Windows
version: 2019Server 10.0.17763 SP0 Multiprocessor Free
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.