我似乎无法让 pyaml 正常工作 - 有人能给我指明正确的方向吗?
novalak@ubuntu:~/DockerApps/autocompose$ python --version
Python 3.8.10
novalak@ubuntu:~/DockerApps/autocompose$ sudo python -m pip install pyyaml
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (5.3.1)
novalak@ubuntu:~/DockerApps/autocompose$ env
PYTHONPATH=/usr/lib/python3/dist-packages
novalak@ubuntu:~/DockerApps/autocompose$ sudo python autocompose.py plesk
Traceback (most recent call last):
File "autocompose.py", line 3, in <module>
import sys, argparse, pyaml, docker
ModuleNotFoundError: No module named 'pyaml'
答案1
请注意,您已安装pyyaml
但正在导入pyaml
。尝试
pip install pyaml
或者import sys, argparse, pyyaml, docker
我认为它将解决问题。