$ ansible
Traceback (most recent call last):
File "/usr/bin/ansible", line 67, in <module>
import ansible.constants as C
File "/usr/lib/python3.7/site-packages/ansible/constants.py", line 11, in <module>
from jinja2 import Template
File "/usr/lib/python3.7/site-packages/jinja2/__init__.py", line 6, in <module>
from markupsafe import escape
ModuleNotFoundError: No module named 'markupsafe'
运行ansible报错, 重装几次都不行。 使用pip3安装markupsafe同样没有效果
看了/usr/lib/python3.7/site-packages/路径下确实找不到markupsafe文件夹, 可能pip给安装到别的地方了 因此安装的时候指定路径即可
pip3 install markupsafe --target=/usr/lib/python3.7/site-packages/