Solve the saltstack "ImportError: No module named salt. scripts" error
I. Problem Description
The automated management tools used on the production line are saltstack, CentOS6.8 x64, and python 2.6.6. They are called not dead. Because some features require python2.7.x, after the upgrade of python2.7, I wrote the saltstack api and found that python2.7 is difficult to use. The principle is that there is no salt module in python2.7. Therefore, pip install salt successfully installs the salt module in python2.7, but I found an error when I restarted salt-master. For example:
Production line, but this cannot be done. Hurry up and recover. Pip uninstall salt
The problem still persists when the salt is started after the module under salt 2.7 is properly loaded.
File "/usr/bin/salt-master", line 6, in <module>
From salt. scripts import salt_master
ImportError: No module named salt. scripts
Ii. Problem Solving
So let's take a look at the source code cat/usr/bin/salt-master, one of the following
From salt. scripts import salt_master
Combined with the error prompt, it is obvious that the module to be imported cannot be started. If the salt module location under python 2.6 is found
/Usr/lib/python2.6/site-packages/salt/
The scripts. py module is not found. Is it true that even the collision module of 2.7 will be able to withstand the attack? The directory contains scripts. po.
This indicates that this module File was available before, but this salt module package is not backed up?
Iii. Solutions
Install salt-master on CentOS6.8 and find the corresponding scripts. uploading py to the production environment is similar to an error. Well, I will package all the salt packages (directories) and overwrite them. Solve the problem!