Discussion:
[salt-users] How to satisfy a Python module dependency on a Windows minion?
Randy Terbush
2015-11-25 15:49:10 UTC
Permalink
Greetings,

I've been struggling to enable functionality for the module.mssql on a
windows minion definition and would appreciate some guidance as to the
proper way to meet dependency requirements that are external to salt-minion
on a Windows client.

Here is what I know:

After provisioning a Windows minion, installing Python and running a
pip.installed: state for pymssql, attempts to run the mssql module continue
to fail with an error message that indicates that the minion was not able
to import the required module.

Running python -c 'import pymssql' from the command line on the Windows
minion works without a problem.

From what I have gathered, it seems that the salt-minion does not see the
site-package resources of the Python install on the minion. I've attempted
to set PYTHONPATH to include the lib/site-packages directory as well as
including lib/site-packages in the system PATH.

I'd appreciate any thoughts toward how to solve this.
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loren Gordon
2015-11-25 16:45:07 UTC
Permalink
Rather than installing a new system-level python environment, can you
install the pymssql package into salt's python environment,
"C:\salt\bin\Lib\site-packages"? Or is that what you were doing with the
PYTHONPATH?

-Loren
Post by Randy Terbush
Greetings,
I've been struggling to enable functionality for the module.mssql on a
windows minion definition and would appreciate some guidance as to the
proper way to meet dependency requirements that are external to salt-minion
on a Windows client.
After provisioning a Windows minion, installing Python and running a
pip.installed: state for pymssql, attempts to run the mssql module continue
to fail with an error message that indicates that the minion was not able
to import the required module.
Running python -c 'import pymssql' from the command line on the Windows
minion works without a problem.
From what I have gathered, it seems that the salt-minion does not see the
site-package resources of the Python install on the minion. I've attempted
to set PYTHONPATH to include the lib/site-packages directory as well as
including lib/site-packages in the system PATH.
I'd appreciate any thoughts toward how to solve this.
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Randy Terbush
2015-11-25 18:13:21 UTC
Permalink
Loren,

Thanks for the response and the suggestion.

Since posting, I've discovered the following doc which educates me a bit
further about salt and Windows.

https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.pip.html

Looks like after installing the module with these additional parameters, I
am moving forward again.

Thanks again
Post by Loren Gordon
Rather than installing a new system-level python environment, can you
install the pymssql package into salt's python environment,
"C:\salt\bin\Lib\site-packages"? Or is that what you were doing with the
PYTHONPATH?
-Loren
Post by Randy Terbush
Greetings,
I've been struggling to enable functionality for the module.mssql on a
windows minion definition and would appreciate some guidance as to the
proper way to meet dependency requirements that are external to salt-minion
on a Windows client.
After provisioning a Windows minion, installing Python and running a
pip.installed: state for pymssql, attempts to run the mssql module continue
to fail with an error message that indicates that the minion was not able
to import the required module.
Running python -c 'import pymssql' from the command line on the Windows
minion works without a problem.
From what I have gathered, it seems that the salt-minion does not see the
site-package resources of the Python install on the minion. I've attempted
to set PYTHONPATH to include the lib/site-packages directory as well as
including lib/site-packages in the system PATH.
I'd appreciate any thoughts toward how to solve this.
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...