简体   繁体   中英

"no module found" in python after installing module via pip

运行 python 脚本(使用 python3)时,我一直看到错误No module named 'ruamel' ,即使在运行命令pip3 install ruamel.yaml

The issue was that the versions of pip and python were mismatched, so pip was installing the ruamel module onto python 3.8, but running python3 was using python 3.9

To diagnose the issue:

  1. Check the python version being used with python3 --version
  2. Check the pip version being used with pip3 --version

If the versions are different, you can call pip with the exact version number. For example, pip3.9 install ruamel.yaml to ensure that the module is installed onto the correct python version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM